Files
lombok/test/transform/resource/after-ecj/VarInFor.java
T
Reinier Zwitserloot 66469e04fe [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.
2018-02-07 00:01:22 +01:00

14 lines
291 B
Java

import lombok.var;
public class VarInFor {
public VarInFor() {
super();
}
public void enhancedFor() {
int[] list = new int[]{1, 2};
for (@var int shouldBeInt : list)
{
System.out.println(shouldBeInt);
@var int shouldBeInt2 = shouldBeInt;
}
}
}