encore icon indicating copy to clipboard operation
encore copied to clipboard

Ignoring parts of tuple in match gives compile error

Open helanhalvan opened this issue 8 years ago • 0 comments

This is a minor nuisance as you can always just replace _ with some_really_long_string_nobody_will_use_as_var_name for the same effect.

class Main {

    def main () : void {
        let
            a = (1,1)
        in
            match a with
                _     => print("legal")
                (x,_) => print("illegal")
    }
}

In this code, the line printing legal compiles, the line printing illegal does not.

helanhalvan avatar Nov 03 '16 12:11 helanhalvan