Skip to content

Commit 71a92a7

Browse files
Handle TermRef and class in provablyDisjoint
1 parent af3215f commit 71a92a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
26092609
provablyDisjoint(tp1, gadtBounds(tp2.symbol).hi) || provablyDisjoint(tp1, tp2.superType)
26102610
case (tp1: TermRef, tp2: TermRef) if isEnumValueOrModule(tp1) && isEnumValueOrModule(tp2) =>
26112611
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)
26122616
case (tp1: TermRef, _) if isEnumValue(tp1) =>
26132617
false
26142618
case (_, tp2: TermRef) if isEnumValue(tp2) =>

0 commit comments

Comments
 (0)