[var] various upgrades to var:

* var is promoted to the main package.
* It is no longer an opt-in thing.
* bug: var (unlike val) is allowed in old-style for loops, but if you multi-init: for (var i = 0, j="Foo";;), you now get an error that you can't do that.
* tests both for the multi-for situation and the new main package variant.
This commit is contained in:
Reinier Zwitserloot
2018-02-06 22:12:42 +01:00
parent 55bcc142d0
commit 66469e04fe
32 changed files with 120 additions and 48 deletions
@@ -0,0 +1,10 @@
//skip compare contents
import lombok.var;
public class VarInForOldMulti {
public void oldForMulti() {
for (var i = 0, j = "Hey"; i < 100; ++i) {
System.out.println(i);
}
}
}