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
61
61
/** Indicates whether the subtype check used GADT bounds */
62
62
private var GADTused : Boolean = false
63
63
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
-
74
64
private var myInstance : TypeComparer = this
75
65
def currentInstance : TypeComparer = myInstance
76
66
@@ -1103,7 +1093,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1103
1093
val tyconIsInjective =
1104
1094
(tycon1sym.isClass || tycon2sym.isClass)
1105
1095
&& (! touchedGADTs || gadtIsInstantiated)
1106
- && ! HKGADTtouched
1096
+ && ! frozenGadt
1107
1097
1108
1098
inFrozenGadtIf(! tyconIsInjective) {
1109
1099
if tycon1sym == tycon2sym && tycon1sym.isAliasType then
@@ -1185,7 +1175,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1185
1175
case tycon2 : TypeRef =>
1186
1176
val tycon2sym = tycon2.symbol
1187
1177
tycon2sym.onGadtBounds { bounds2 =>
1188
- touchHKGadt { compareLower(bounds2, tyconIsTypeRef = false ) }
1178
+ inFrozenGadt { compareLower(bounds2, tyconIsTypeRef = false ) }
1189
1179
}
1190
1180
case _ => false
1191
1181
} && { GADTused = true ; true }
You can’t perform that action at this time.
0 commit comments