@@ -2,7 +2,9 @@ package dotty.tools
2
2
package dotc
3
3
package core
4
4
5
- import Symbols ._ , Types ._ , Contexts ._ , Flags ._ , Names ._ , StdNames ._ , Decorators ._ , Flags .JavaDefined
5
+ import Symbols ._ , Types ._ , Contexts ._ , Flags ._ , Names ._ , StdNames ._ , Decorators ._
6
+ import Flags .JavaDefined
7
+ import NameOps ._
6
8
import Uniques .unique
7
9
import dotc .transform .ExplicitOuter ._
8
10
import dotc .transform .ValueClasses ._
@@ -327,6 +329,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
327
329
* - For a typeref scala.Any, scala.AnyVal or scala.Singleton: |java.lang.Object|
328
330
* - For a typeref scala.Unit, |scala.runtime.BoxedUnit|.
329
331
* - For a typeref scala.FunctionN, where N > MaxImplementedFunctionArity, scala.FunctionXXL
332
+ * - For a typeref scala.ImplicitFunctionN, | scala.FunctionN |
330
333
* - For a typeref P.C where C refers to a class, <noprefix> # C.
331
334
* - For a typeref P.C where C refers to an alias type, the erasure of C's alias.
332
335
* - For a typeref P.C where C refers to an abstract type, the erasure of C's upper bound.
@@ -356,6 +359,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
356
359
else if (semiEraseVCs && isDerivedValueClass(sym)) eraseDerivedValueClassRef(tp)
357
360
else if (sym == defn.ArrayClass ) apply(tp.appliedTo(TypeBounds .empty)) // i966 shows that we can hit a raw Array type.
358
361
else if (defn.isUnimplementedFunctionClass(sym)) defn.FunctionXXLType
362
+ else if (defn.isImplicitFunctionClass(sym)) apply(defn.FunctionType (sym.name.functionArity))
359
363
else eraseNormalClassRef(tp)
360
364
case tp : RefinedType =>
361
365
val parent = tp.parent
@@ -492,7 +496,10 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
492
496
val erasedVCRef = eraseDerivedValueClassRef(tp)
493
497
if (erasedVCRef.exists) return sigName(erasedVCRef)
494
498
}
495
- normalizeClass(sym.asClass).fullName.asTypeName
499
+ if (defn.isImplicitFunctionClass(sym))
500
+ sigName(defn.FunctionType (sym.name.functionArity))
501
+ else
502
+ normalizeClass(sym.asClass).fullName.asTypeName
496
503
case defn.ArrayOf (elem) =>
497
504
sigName(this (tp))
498
505
case JavaArrayType (elem) =>
0 commit comments