jdk-24/test/langtools/tools/javac/patterns/ForEachTestAllAnalyzers.java
Aggelos Biboudis 2cb64a7557 8294943: Implement record patterns in enhanced for
8296802: Parse errors when deconstructing a record using the enhanced for loop of JEP 432

Co-authored-by: Jan Lahoda <jlahoda@openjdk.org>
Co-authored-by: Aggelos Biboudis <abimpoudis@openjdk.org>
Co-authored-by: Maurizio Cimadamore <mcimadamore@openjdk.org>
Reviewed-by: mcimadamore, vromero
2022-12-01 12:40:09 +00:00

12 lines
275 B
Java

/*
* @test /nodynamiccopyright/
* @summary
* @enablePreview
* @compile -XDfind=all ForEachTestAllAnalyzers.java
*/
public class ForEachTestAllAnalyzers {
private void test(Iterable<? extends R> l) {
for (R(Object a) : l) { }
}
record R(Object a) {}
}