mirror of
https://github.com/erg-lang/erg.git
synced 2025-12-23 05:36:48 +00:00
9 lines
191 B
Python
9 lines
191 B
Python
f x: Obj =
|
|
match x:
|
|
(s: Str) -> s + "a"
|
|
{ foo; bar } -> foo + bar
|
|
a -> a
|
|
|
|
assert f("a") == "aa"
|
|
assert f({ foo = "a"; bar = "b" }) == "ab"
|
|
assert str(f(1)) == "1"
|