test/langtools/tools/javac/switchextra/SwitchArrowBrokenConstant.java
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 59021 cfc7bb9a5a92
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com

/*
 * @test /nodymaticcopyright/
 * @bug 8206986
 * @summary Verify reasonable errors are produced when neither ':' nor '->'
 *          is found are the expression of a case
 * @compile/fail/ref=SwitchArrowBrokenConstant.out -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
 */

public class SwitchArrowBrokenConstant {

    private String likeLambda(int i) {
        switch (i) {
            case (a, b) -> {}
        }
        return switch (i) {
            case (a, b) -> {}
        };
        switch (i) {
            case a;
        }
        return switch (i) {
            case a;
        };
        switch (i) {
            default ;
        }
        return switch (i) {
            default ;
        };
    }

}