encore
encore copied to clipboard
Ignoring parts of tuple in match gives compile error
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.