Skip to content

Commit 1119cb5

Browse files
committed
Use isRefinedFunctionType in place of poly || erased
1 parent 5922dc3 commit 1119cb5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,9 +960,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
960960
&& tree.isTerm
961961
&& {
962962
val qualType = tree.qualifier.tpe
963-
hasRefinement(qualType) &&
964-
!qualType.derivesFrom(defn.PolyFunctionClass) &&
965-
!defn.isErasedFunctionType(qualType)
963+
hasRefinement(qualType) && !defn.isRefinedFunctionType(qualType)
966964
}
967965
def loop(tree: Tree): Boolean = tree match
968966
case TypeApply(fun, _) =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ class Definitions {
16811681

16821682
/** Is `tp` a specialized, refined function type? Either an `ErasedFunction` or a `PolyFunction`. */
16831683
def isRefinedFunctionType(tp: Type)(using Context): Boolean =
1684-
(tp.typeSymbol eq defn.PolyFunctionClass) || isErasedFunctionType(tp)
1684+
tp.derivesFrom(defn.PolyFunctionClass) || isErasedFunctionType(tp)
16851685

16861686
def isFunctionOrPolyType(tp: Type)(using Context): Boolean =
16871687
isFunctionType(tp) || isRefinedFunctionType(tp)

0 commit comments

Comments
 (0)