Skip to content

Commit

Permalink
Simplify polyFunction logic in TypeComparer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Jul 14, 2023
1 parent 9ffd44e commit 4b3d61b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -666,17 +666,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
isSubType(info1, info2)

if defn.isFunctionType(tp2) then
if defn.isPolyFunctionType(tp2) then
// TODO should we handle ErasedFunction is this same way?
tp1.member(nme.apply).info match
case info1: PolyType =>
return isSubInfo(info1, tp2.refinedInfo)
case _ =>
else
tp1w.widenDealias match
case tp1: RefinedType =>
return isSubInfo(tp1.refinedInfo, tp2.refinedInfo)
case _ =>
tp1w.widenDealias match
case tp1: RefinedType =>
return isSubInfo(tp1.refinedInfo, tp2.refinedInfo)
case _ =>

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

0 comments on commit 4b3d61b

Please sign in to comment.