File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1487,10 +1487,15 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
14871487 * Delegates to compareS if `tycon` is scala.compiletime.S. Otherwise, constant folds if possible.
14881488 */
14891489 def compareCompiletimeAppliedType (tp : AppliedType , other : Type , fromBelow : Boolean ): Boolean = {
1490- if ( defn.isCompiletime_S(tp.tycon.typeSymbol)) compareS(tp, other, fromBelow)
1491- else {
1490+ defn.isCompiletime_S(tp.tycon.typeSymbol) && compareS(tp, other, fromBelow)
1491+ || {
14921492 val folded = tp.tryCompiletimeConstantFold
14931493 if (fromBelow) recur(other, folded) else recur(folded, other)
1494+ } || other.match {
1495+ case other : TypeRef if ! fromBelow && other.symbol == defn.SingletonClass =>
1496+ tp.args.forall(arg => isSubType(arg, defn.SingletonType ))
1497+ // Compile-time operations with singleton arguments are singletons
1498+ case _ => false
14941499 }
14951500 }
14961501
You can’t perform that action at this time.
0 commit comments