File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1167,14 +1167,16 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
11671167 else
11681168 fallback(tycon2bounds.lo)
11691169
1170- def compareTyConGadtBounds : Boolean =
1171- tycon2 match
1172- case tycon2 : TypeRef =>
1173- val tycon2sym = tycon2.symbol
1174- tycon2sym.onGadtBounds { bounds2 =>
1175- compareLower(bounds2, tyconIsTypeRef = false )
1176- }
1177- case _ => false
1170+ def byGadtBounds : Boolean =
1171+ {
1172+ tycon2 match
1173+ case tycon2 : TypeRef =>
1174+ val tycon2sym = tycon2.symbol
1175+ tycon2sym.onGadtBounds { bounds2 =>
1176+ compareLower(bounds2, tyconIsTypeRef = false )
1177+ }
1178+ case _ => false
1179+ } && { GADTused = true ; true }
11781180
11791181 tycon2 match {
11801182 case param2 : TypeParamRef =>
@@ -1183,7 +1185,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
11831185 compareLower(bounds(param2), tyconIsTypeRef = false )
11841186 case tycon2 : TypeRef =>
11851187 isMatchingApply(tp1) ||
1186- compareTyConGadtBounds ||
1188+ byGadtBounds ||
11871189 defn.isCompiletimeAppliedType(tycon2.symbol) && compareCompiletimeAppliedType(tp2, tp1, fromBelow = true ) || {
11881190 tycon2.info match {
11891191 case info2 : TypeBounds =>
You can’t perform that action at this time.
0 commit comments