Skip to content

Commit 8e119ef

Browse files
Rollback constraints if isSameType failed in second direction
1 parent fd2a03e commit 8e119ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/core/TypeComparer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
23042304
Stats.record("cache same type")
23052305
sames = new util.EqHashMap()
23062306
val res =
2307-
try isSubType(tp1, tp2) && isSubType(tp2, tp1)
2307+
try rollbackConstraintsUnless(isSubType(tp1, tp2) && isSubType(tp2, tp1))
23082308
finally
23092309
sameLevel -= 1
23102310
sames = savedSames

0 commit comments

Comments
 (0)