File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1207,9 +1207,12 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1207
1207
if fromBelow then isSubType(tp2, tp1) else isSubType(tp1, tp2)
1208
1208
def directionalRecur (tp1 : Type , tp2 : Type ): Boolean =
1209
1209
if fromBelow then recur(tp2, tp1) else recur(tp1, tp2)
1210
-
1211
- val otherTycon = other.tycon
1212
- val otherArgs = other.args
1210
+ val otherDealias = other.dealias match
1211
+ case appliedType : AppliedType if appliedType.args.hasSameLengthAs(args) && ! other.args.hasSameLengthAs(args) =>
1212
+ appliedType
1213
+ case _ => other
1214
+ val otherTycon = otherDealias.tycon
1215
+ val otherArgs = otherDealias.args
1213
1216
1214
1217
val d = otherArgs.length - args.length
1215
1218
d >= 0 && {
@@ -1234,7 +1237,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1234
1237
otherTycon
1235
1238
rollbackConstraintsUnless :
1236
1239
(assumedTrue(tycon) || directionalIsSubType(tycon, adaptedTycon))
1237
- && directionalRecur(adaptedTycon.appliedTo(args), other )
1240
+ && directionalRecur(adaptedTycon.appliedTo(args), otherDealias )
1238
1241
}
1239
1242
}
1240
1243
end compareAppliedTypeParamRef
You can’t perform that action at this time.
0 commit comments