LVTI diagnostics anomaly?

Stephan Janssen sja at devoxx.com
Tue Sep 19 16:30:56 UTC 2017


Hey,

The LVTI diagnostics error messages have (according to me) an inconsistency.
LocalRedundantType.java

examples/LocalRedundantType.java:31: warning: Redundant type for local
variable (replace explicit type with 'var'). String s = ""; ^ 1 warning


The above makes a suggestion to replace the explicit type with 'var', which
is great.

However, VarNotAllowedHere.java mentions that the above

var s = "";

is not allowed, which confuses me.
VarNotAllowedHere.java

examples/VarNotAllowedHere.java:29: error: 'var' is not allowed here var s
= ""; ^ 1 error

Hopefully this helps?

Cheers,

Stephan


More information about the amber-dev mailing list