Don't emit @SafeVarargs for reifiable types#71
Don't emit @SafeVarargs for reifiable types#71bndbsh wants to merge 2 commits intodanielnorberg:masterfrom
@SafeVarargs for reifiable types#71Conversation
Attempt to detect if a type is reifiable, and omit the annotation in those cases. https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html However one problem as noted in the comments is we can't get at a ParameterizedTypeName's enclosing type. So for instance, this code will treat `Foo<X>.Bar` as reifiable, even though it isn't. One idea to get around it would be to `toString()` the type and check if it contains any type parameters, although that seems kinda messy.
|
Hi! Giving a look at how @SafeVarargs
@SuppressWarnings("varargs") |
|
|
|
Would using Javac with |
|
@danielnorberg in my case, with Java 11, Javac with |
|
@lepistone Indeed. I had simply failed to enable |
|
Although the |
Attempt to detect if a type is reifiable, and omit the annotation in
those cases.
https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html
However one problem as noted in the comments is we can't get at a
ParameterizedTypeName's enclosing type. So for instance, this code will
treat
Foo<X>.Baras reifiable, even though it isn't.One idea to get around it would be to
toString()the type and check ifit contains any type parameters, although that seems kinda messy.