Skip to content

Commit 4b3d61b

Browse files
committed
Simplify polyFunction logic in TypeComparer
1 parent 9ffd44e commit 4b3d61b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -666,17 +666,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
666666
isSubType(info1, info2)
667667

668668
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 _ =>
669+
tp1w.widenDealias match
670+
case tp1: RefinedType =>
671+
return isSubInfo(tp1.refinedInfo, tp2.refinedInfo)
672+
case _ =>
680673

681674
val skipped2 = skipMatching(tp1w, tp2)
682675
if (skipped2 eq tp2) || !Config.fastPathForRefinedSubtype then

0 commit comments

Comments
 (0)