Skip to content

Commit d0f6397

Browse files
Restore TermRef test when tp2 is fully instantiated
1 parent 7324080 commit d0f6397

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,10 +2614,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
26142614
provablyDisjoint(tp1, gadtBounds(tp2.symbol).hi) || provablyDisjoint(tp1, tp2.superType)
26152615
case (tp1: TermRef, tp2: TermRef) if isEnumValueOrModule(tp1) && isEnumValueOrModule(tp2) =>
26162616
tp1.termSymbol != tp2.termSymbol
2617-
case (tp1: TermRef, _) if isEnumValue(tp1) =>
2618-
false
2619-
case (_, tp2: TermRef) if isEnumValue(tp2) =>
2620-
false
2617+
case (tp1: TermRef, tp2: TypeRef) if isEnumValue(tp1) =>
2618+
fullyInstantiated(tp2) && !tp1.classSymbols.exists(_.derivesFrom(tp2.symbol))
2619+
case (tp1: TypeRef, tp2: TermRef) if isEnumValue(tp2) =>
2620+
fullyInstantiated(tp1) && !tp2.classSymbols.exists(_.derivesFrom(tp1.symbol))
26212621
case (tp1: Type, tp2: Type) if defn.isTupleType(tp1) =>
26222622
provablyDisjoint(tp1.toNestedPairs, tp2)
26232623
case (tp1: Type, tp2: Type) if defn.isTupleType(tp2) =>

0 commit comments

Comments
 (0)