buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Match statement

Open giann opened this issue 3 years ago • 0 comments

match (n) {
    Locale.frFR,
    Locale.frBE -> {
        print("On parle français!");

        return true;
    },
    Locale.en -> print("we speak english!"),
    default -> print("Single statement is allowed"),
}

If evaluated expression is an EnumInstance we can detect missing cases.

giann avatar Sep 08 '22 06:09 giann