File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1167,13 +1167,23 @@ 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
1178+
11701179 tycon2 match {
11711180 case param2 : TypeParamRef =>
11721181 isMatchingApply(tp1) ||
11731182 canConstrain(param2) && canInstantiate(param2) ||
11741183 compareLower(bounds(param2), tyconIsTypeRef = false )
11751184 case tycon2 : TypeRef =>
11761185 isMatchingApply(tp1) ||
1186+ compareTyConGadtBounds ||
11771187 defn.isCompiletimeAppliedType(tycon2.symbol) && compareCompiletimeAppliedType(tp2, tp1, fromBelow = true ) || {
11781188 tycon2.info match {
11791189 case info2 : TypeBounds =>
You can’t perform that action at this time.
0 commit comments