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