Closed
Description
class Foo[A] {
def foo[T](x: T) = x
}
Compiled with scalac
:
public class Foo<A> {
public <T> T foo(T);
Code:
0: aload_1
1: areturn
public Foo();
Code:
0: aload_0
1: invokespecial #19 // Method java/lang/Object."<init>":()V
4: return
}
Compiled with dotty:
public class Foo {
public Foo();
Code:
0: aload_0
1: invokespecial #9 // Method java/lang/Object."<init>":()V
4: return
public java.lang.Object foo(java.lang.Object);
Code:
0: aload_1
1: areturn
}
The type parameters in the bytecode are used by javac
, see tests/pending/pos/java-interop/t1263
and tests/pending/pos/java-interop/t1745
for examples (these tests are currently not run with javac even though they should, this is fixed by #1289 which moves them to pending until this is fixed).