diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index 6ce708068393..393ac0f03f4f 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -9,7 +9,7 @@ import core.Definitions import core.Flags._ import core.Names.Name import core.Symbols._ -import core.TypeApplications.TypeParamInfo +import core.TypeApplications.{EtaExpansion, TypeParamInfo} import core.TypeErasure.{erasedGlb, erasure, isGenericArrayElement} import core.Types._ import core.classfile.ClassfileConstants @@ -166,6 +166,7 @@ object GenericSignatures { // a type parameter or similar) must go through here or the signature is // likely to end up with Foo.Empty where it needs Foo.Empty$. def fullNameInSig(sym: Symbol): Unit = { + assert(sym.isClass) val name = atPhase(genBCodePhase) { sanitizeName(sym.fullName).replace('.', '/') } builder.append('L').nn.append(name) } @@ -183,11 +184,10 @@ object GenericSignatures { boxedSig(bounds.lo) } else builder.append('*') - case PolyType(_, res) => - builder.append('*') // scala/bug#7932 + case EtaExpansion(tp) => + argSig(tp) case _: HKTypeLambda => - fullNameInSig(tp.typeSymbol) - builder.append(';') + builder.append('*') case _ => boxedSig(tp) } diff --git a/tests/run/t7932.check b/tests/run/t7932.check index 5d2d50162801..5ba7ec1a3216 100644 --- a/tests/run/t7932.check +++ b/tests/run/t7932.check @@ -1,9 +1,13 @@ public Category C.category() public Category C.category1() +public abstract Category M2.category3() +public abstract Category M2.category2() public default Category M1.category() public default Category M1.category1() public static Category M1.category$(M1) public static Category M1.category1$(M1) +public abstract Category M2.category3() +public abstract Category M2.category2() public default Category M2.category() public default Category M2.category1() public static Category M2.category$(M2) diff --git a/tests/run/t7932.scala b/tests/run/t7932.scala index de72f3eb54f4..4f943b33f09d 100644 --- a/tests/run/t7932.scala +++ b/tests/run/t7932.scala @@ -13,6 +13,10 @@ trait M1[F] { trait M2[F] { self: M1[F] => override def category: Category[X] = null override def category1: Category[Tuple2] = null + + type T[A, B] + def category2: Category[T] + def category3: Category[[A, B] =>> T[B, A]] } abstract class C extends M1[Float] with M2[Float]