jdk-24/test/langtools/tools/javac/patterns/PatternErrorRecovery.java
Jan Lahoda eaa80ad08c 8300543: Compiler Implementation for Pattern Matching for switch
8300545: Compiler Implementation for Record Patterns

Co-authored-by: Aggelos Biboudis <abimpoudis@openjdk.org>
Reviewed-by: vromero, mcimadamore
2023-05-22 04:24:06 +00:00

16 lines
561 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8268320
* @summary Verify user-friendly errors are reported for ill-formed pattern.
* @compile/fail/ref=PatternErrorRecovery.out -XDrawDiagnostics -XDshould-stop.at=FLOW PatternErrorRecovery.java
* @compile/fail/ref=PatternErrorRecovery-old.out --release 20 -XDrawDiagnostics -XDshould-stop.at=FLOW PatternErrorRecovery.java
*/
public class PatternErrorRecovery {
void errorRecoveryNoPattern1(Object o) {
switch (o) {
case String: break;
case Object obj: break;
}
}
}