erg/tests/should_ok/pattern.er
2023-06-08 02:33:33 +09:00

17 lines
230 B
Python

f {.x; .y}, [_], (_, _) = x + y
x = f {.x = 1; .y = 2}, [3], (4, 5)
assert x == 3
g _: Int = None
g 10
h _: Int, _: Int = None
h 10, 20
#[
and: [Bool; 2] -> Bool
and [True, t] = t
and [_, _] = False
assert and [True, True]
]#