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
Bippy.scala:1: warning: no valid targets for annotation on value str - it is discarded unused. You may specify targets with meta-annotations, e.g. @(transient @param)
class Bippy(@transient str: String) {
^
one warning found
However, javap shows that the field is indeed marked transient, so the warning is inaccurate:
Compiled from "Bippy.scala"
public class Bippy {
private final transient java.lang.String str;
public java.lang.String toString();
public Bippy(java.lang.String);
}
Attempting to eliminate the warning by adding @(transient @field) does no good. In fact, the compiler is only happy when I mark the field @(transient @param) which is not what I want. Why would I want the parameter to be marked transient? It is the field that matters. In fact, looking at the source, scala.transient is already annotated with @field so no extra meta-annotation should be needed.
The superfluous warning just needs to go away.
The text was updated successfully, but these errors were encountered:
Compiling the following code with scala 2.11.7
elicits the following warning:
However, javap shows that the field is indeed marked transient, so the warning is inaccurate:
Attempting to eliminate the warning by adding
@(transient @field)
does no good. In fact, the compiler is only happy when I mark the field@(transient @param)
which is not what I want. Why would I want the parameter to be marked transient? It is the field that matters. In fact, looking at the source,scala.transient
is already annotated with@field
so no extra meta-annotation should be needed.The superfluous warning just needs to go away.
The text was updated successfully, but these errors were encountered: