Skip to content

Commit 75e7c41

Browse files
committed
Fix Singleton handling of compile-time operations
1 parent 630c6dc commit 75e7c41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
15041504
if (fromBelow) recur(other, folded) else recur(folded, other)
15051505
} || other.match {
15061506
case other: TypeRef if !fromBelow && other.symbol == defn.SingletonClass =>
1507-
true // Even if not declared, the result of a compiletime operator is a constant type
1507+
tp.args.forall(arg => isSubType(arg, defn.SingletonType))
1508+
// Compile-time operations with singleton arguments are singletons
15081509
case _ => false
15091510
}
15101511
}

0 commit comments

Comments
 (0)