Skip to content

Commit 93d3c2a

Browse files
committed
Moved PolyFunction sig logic to TypeErasure#sigName
1 parent 6f8ed88 commit 93d3c2a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
605605
case tp: TypeVar =>
606606
val inst = tp.instanceOpt
607607
if (inst.exists) sigName(inst) else tpnme.Uninstantiated
608+
case RefinedType(parent, nme.apply, refinedInfo) if parent.typeSymbol eq defn.PolyFunctionClass =>
609+
sigName(defn.FunctionType(refinedInfo.resultType.paramNamess.head.length))
608610
case tp: TypeProxy =>
609611
sigName(tp.underlying)
610612
case _: ErrorType | WildcardType | NoType =>

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,15 +3196,7 @@ object Types {
31963196

31973197

31983198
def computeSignature(implicit ctx: Context): Signature = {
3199-
def polyFunctionSignature(tp: Type): Type = tp match {
3200-
case RefinedType(parent, nme.apply, refinedInfo) if parent.typeSymbol eq defn.PolyFunctionClass =>
3201-
val res = refinedInfo.resultType
3202-
val paramss = res.paramNamess
3203-
defn.FunctionType(paramss.head.length)
3204-
case _ => tp
3205-
}
3206-
3207-
val params = if (isErasedMethod) Nil else paramInfos.mapConserve(polyFunctionSignature)
3199+
val params = if (isErasedMethod) Nil else paramInfos
32083200
resultSignature.prepend(params, isJavaMethod)
32093201
}
32103202

0 commit comments

Comments
 (0)