We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af3215f commit 71a92a7Copy full SHA for 71a92a7
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -2609,6 +2609,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
2609
provablyDisjoint(tp1, gadtBounds(tp2.symbol).hi) || provablyDisjoint(tp1, tp2.superType)
2610
case (tp1: TermRef, tp2: TermRef) if isEnumValueOrModule(tp1) && isEnumValueOrModule(tp2) =>
2611
tp1.termSymbol != tp2.termSymbol
2612
+ case (tp1: TermRef, tp2: TypeRef) if isEnumValue(tp1) && tp2.symbol.isClass =>
2613
+ !isSubType(tp1, tp2)
2614
+ case (tp1: TypeRef, tp2: TermRef) if isEnumValue(tp2) && tp1.symbol.isClass =>
2615
+ !isSubType(tp2, tp1)
2616
case (tp1: TermRef, _) if isEnumValue(tp1) =>
2617
false
2618
case (_, tp2: TermRef) if isEnumValue(tp2) =>
0 commit comments