From 8e119ef23ce1244dfc29249e953a90035c174574 Mon Sep 17 00:00:00 2001 From: Eugene Flesselle Date: Fri, 5 Apr 2024 19:46:42 +0200 Subject: [PATCH] Rollback constraints if isSameType failed in second direction --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 94872dc1e8d2..34614d3d0acd 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -2304,7 +2304,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling Stats.record("cache same type") sames = new util.EqHashMap() val res = - try isSubType(tp1, tp2) && isSubType(tp2, tp1) + try rollbackConstraintsUnless(isSubType(tp1, tp2) && isSubType(tp2, tp1)) finally sameLevel -= 1 sames = savedSames