Skip to content

Commit 96af363

Browse files
committed
Rename isRefinedFunctionType to isPolyOrErasedFunctionType
1 parent aca69bd commit 96af363

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
968968
&& tree.isTerm
969969
&& {
970970
val qualType = tree.qualifier.tpe
971-
hasRefinement(qualType) && !defn.isRefinedFunctionType(qualType)
971+
hasRefinement(qualType) && !defn.isPolyOrErasedFunctionType(qualType)
972972
}
973973
def loop(tree: Tree): Boolean = tree match
974974
case TypeApply(fun, _) =>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ class Definitions {
17141714
isNonRefinedFunction(tp.dropDependentRefinement)
17151715

17161716
/** Is `tp` a specialized, refined function type? Either an `ErasedFunction` or a `PolyFunction`. */
1717-
def isRefinedFunctionType(tp: Type)(using Context): Boolean =
1717+
def isPolyOrErasedFunctionType(tp: Type)(using Context): Boolean =
17181718
isPolyFunctionType(tp) || isErasedFunctionType(tp)
17191719

17201720
/** Is `tp` a specialized, refined `PolyFunction` type? */
@@ -1732,7 +1732,7 @@ class Definitions {
17321732
* - PolyFunction
17331733
*/
17341734
def isFunctionType(tp: Type)(using Context): Boolean =
1735-
isFunctionNType(tp) || isRefinedFunctionType(tp)
1735+
isFunctionNType(tp) || isPolyOrErasedFunctionType(tp)
17361736

17371737
private def withSpecMethods(cls: ClassSymbol, bases: List[Name], paramTypes: Set[TypeRef]) =
17381738
if !ctx.settings.Yscala2Stdlib.value then

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ class TypeApplications(val self: Type) extends AnyVal {
509509
* Handles `ErasedFunction`s and poly functions gracefully.
510510
*/
511511
final def functionArgInfos(using Context): List[Type] = self.dealias match
512-
case RefinedType(parent, nme.apply, mt: MethodType) if defn.isRefinedFunctionType(parent) => (mt.paramInfos :+ mt.resultType)
512+
case RefinedType(parent, nme.apply, mt: MethodType) if defn.isPolyOrErasedFunctionType(parent) => (mt.paramInfos :+ mt.resultType)
513513
case _ => self.dropDependentRefinement.dealias.argInfos
514514

515515
/** Argument types where existential types in arguments are disallowed */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
654654
else SuperType(eThis, eSuper)
655655
case ExprType(rt) =>
656656
defn.FunctionType(0)
657-
case RefinedType(parent, nme.apply, refinedInfo) if defn.isRefinedFunctionType(parent) =>
657+
case RefinedType(parent, nme.apply, refinedInfo) if defn.isPolyOrErasedFunctionType(parent) =>
658658
eraseRefinedFunctionApply(refinedInfo)
659659
case tp: TypeVar if !tp.isInstantiated =>
660660
assert(inSigName, i"Cannot erase uninstantiated type variable $tp")
@@ -936,7 +936,7 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
936936
sigName(defn.FunctionOf(Nil, rt))
937937
case tp: TypeVar if !tp.isInstantiated =>
938938
tpnme.Uninstantiated
939-
case tp @ RefinedType(parent, nme.apply, _) if defn.isRefinedFunctionType(parent) =>
939+
case tp @ RefinedType(parent, nme.apply, _) if defn.isPolyOrErasedFunctionType(parent) =>
940940
// we need this case rather than falling through to the default
941941
// because RefinedTypes <: TypeProxy and it would be caught by
942942
// the case immediately below

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ object Erasure {
679679
// Instead, we manually lookup the type of `apply` in the qualifier.
680680
inContext(preErasureCtx) {
681681
val qualTp = tree.qualifier.typeOpt.widen
682-
if defn.isRefinedFunctionType(qualTp) then
682+
if defn.isPolyOrErasedFunctionType(qualTp) then
683683
eraseRefinedFunctionApply(qualTp.select(nme.apply).widen).classSymbol
684684
else
685685
NoSymbol

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ object TreeChecker {
447447
val tpe = tree.typeOpt
448448

449449
// PolyFunction and ErasedFunction apply methods stay structural until Erasure
450-
val isRefinedFunctionApply = (tree.name eq nme.apply) && defn.isRefinedFunctionType(tree.qualifier.typeOpt)
450+
val isRefinedFunctionApply = (tree.name eq nme.apply) && defn.isPolyOrErasedFunctionType(tree.qualifier.typeOpt)
451451
// Outer selects are pickled specially so don't require a symbol
452452
val isOuterSelect = tree.name.is(OuterSelectName)
453453
val isPrimitiveArrayOp = ctx.erasedTypes && nme.isPrimitiveName(tree.name)

0 commit comments

Comments
 (0)