Skip to content

Commit

Permalink
Fix Singleton handling of compile-time operations
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Oct 13, 2023
1 parent 630c6dc commit 75e7c41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
if (fromBelow) recur(other, folded) else recur(folded, other)
} || other.match {
case other: TypeRef if !fromBelow && other.symbol == defn.SingletonClass =>
true // Even if not declared, the result of a compiletime operator is a constant type
tp.args.forall(arg => isSubType(arg, defn.SingletonType))
// Compile-time operations with singleton arguments are singletons
case _ => false
}
}
Expand Down

0 comments on commit 75e7c41

Please sign in to comment.