File tree 1 file changed +12
-10
lines changed
compiler/src/dotty/tools/dotc/core 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -665,16 +665,18 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
665
665
case _ =>
666
666
isSubType(info1, info2)
667
667
668
- if defn.isFunctionNType(tp2) then
669
- tp1w.widenDealias match
670
- case tp1 : RefinedType =>
671
- return isSubInfo(tp1.refinedInfo, tp2.refinedInfo)
672
- case _ =>
673
- else if tp2.parent.typeSymbol == defn.PolyFunctionClass then
674
- tp1.member(nme.apply).info match
675
- case info1 : PolyType =>
676
- return isSubInfo(info1, tp2.refinedInfo)
677
- case _ =>
668
+ if defn.isFunctionType(tp2) then
669
+ if defn.isPolyFunctionType(tp2) then
670
+ // TODO should we handle ErasedFunction is this same way?
671
+ tp1.member(nme.apply).info match
672
+ case info1 : PolyType =>
673
+ return isSubInfo(info1, tp2.refinedInfo)
674
+ case _ =>
675
+ else
676
+ tp1w.widenDealias match
677
+ case tp1 : RefinedType =>
678
+ return isSubInfo(tp1.refinedInfo, tp2.refinedInfo)
679
+ case _ =>
678
680
679
681
val skipped2 = skipMatching(tp1w, tp2)
680
682
if (skipped2 eq tp2) || ! Config .fastPathForRefinedSubtype then
You can’t perform that action at this time.
0 commit comments