Skip to content

Commit 8ee6f06

Browse files
committed
Emit generic signature for static forwarders to nullary methods
1 parent cbb1e07 commit 8ee6f06

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
926926
// (one that doesn't erase to the actual signature). See run/t3452b for a test case.
927927

928928
val memberTpe = atPhase(erasurePhase) { moduleClass.denot.thisType.memberInfo(sym) }
929-
val erasedMemberType = TypeErasure.fullErasure(memberTpe)
929+
val erasedMemberType = TypeErasure.transformInfo(sym, memberTpe)
930930
if (erasedMemberType =:= sym.denot.info)
931931
getGenericSignatureHelper(sym, moduleClass, memberTpe).orNull
932932
else null

tests/pos/i10347/A_1.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
trait L[+T] { def head: T }
2+
object A {
3+
def foo: L[String] = ???
4+
}

tests/pos/i10347/C_2.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public class C_2 {
2+
String hi = A.foo().head();
3+
}

0 commit comments

Comments
 (0)