File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -61,16 +61,6 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
6161 /** Indicates whether the subtype check used GADT bounds */
6262 private var GADTused : Boolean = false
6363
64- /** Indicates whether we have touched HKT GADT bounds */
65- private var HKGADTtouched : Boolean = false
66-
67- private def touchHKGadt [T ](body : => T ): T =
68- val savedHKGADTtouched = HKGADTtouched
69- HKGADTtouched = true
70- val res = body
71- HKGADTtouched = savedHKGADTtouched
72- res
73-
7464 private var myInstance : TypeComparer = this
7565 def currentInstance : TypeComparer = myInstance
7666
@@ -1103,7 +1093,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
11031093 val tyconIsInjective =
11041094 (tycon1sym.isClass || tycon2sym.isClass)
11051095 && (! touchedGADTs || gadtIsInstantiated)
1106- && ! HKGADTtouched
1096+ && ! frozenGadt
11071097
11081098 inFrozenGadtIf(! tyconIsInjective) {
11091099 if tycon1sym == tycon2sym && tycon1sym.isAliasType then
@@ -1185,7 +1175,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
11851175 case tycon2 : TypeRef =>
11861176 val tycon2sym = tycon2.symbol
11871177 tycon2sym.onGadtBounds { bounds2 =>
1188- touchHKGadt { compareLower(bounds2, tyconIsTypeRef = false ) }
1178+ inFrozenGadt { compareLower(bounds2, tyconIsTypeRef = false ) }
11891179 }
11901180 case _ => false
11911181 } && { GADTused = true ; true }
You can’t perform that action at this time.
0 commit comments