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
1487
1487
* Delegates to compareS if `tycon` is scala.compiletime.S. Otherwise, constant folds if possible.
1488
1488
*/
1489
1489
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
+ || {
1492
1492
val folded = tp.tryCompiletimeConstantFold
1493
1493
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
1494
1499
}
1495
1500
}
1496
1501
You can’t perform that action at this time.
0 commit comments