jdk-24/test/langtools/tools/javac/foreach/7139681/T7139681neg.java
2017-09-12 19:03:39 +02:00

17 lines
346 B
Java

/*
* @test /nodynamiccopyright/
* @bug 7139681
* @summary Enhanced for loop: local variable scope inconsistent with JLS
*
* @compile/fail/ref=T7139681neg.out -XDrawDiagnostics T7139681neg.java
*/
class T7139681neg {
void testArray() {
for (int a : a) { }
}
void testIterable() {
for (Integer b : b) { }
}
}