You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both of the methods here haveA erased to Int (see the descriptor in the output of javap), the problem is that the generic java signature we generate for bar is incorrect (this is what javap uses to display the method signature but it's not the actual bytecode signature, it's only used by javac), A shouldn't be preserved in Signature when its upper-bound is a primitive type:
% javap -p -v Foo.class
[...]
public int foo();
descriptor: ()I
[...]
public <A extends java.lang.Object> A bar(A);
descriptor: (I)I
[...]
Signature:#28// <A:Ljava/lang/Object;>(TA;)TA;
[...}
smarter
changed the title
Complex types bound to primitives should compile to primitive types
Invalid generic signature for type params bounded by primitive
Jun 8, 2022
This issue was picked for the Issue Spree No. 24 of 29 November 2022 which takes place in a week from now. @jan-pieter, @nmcb, @TheElectronWill will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.
Compiler version
3.1.6
Minimized code
Output
Expectation
It is important for performance of code dealing with types carrying meta-information like
The text was updated successfully, but these errors were encountered: