erg/examples/set.er
Shunsuke Shibayama 2cf4b5aba8 Add SetTypeSpec
2022-10-07 10:59:58 +09:00

9 lines
334 B
Python

a = {1, 2, 3, 1, 2, 3} # {1, 2, 3} in no particular order
assert {1, 2, 3} == {1, 2, 3}
b = {"a", "a", "b", "b", "a", "b"} # {"a", "b"} in no particular order
assert {"a", "b"} == {"a", "b"}
c: {Int; _} = {-1, 1, -1, 1} # {-1, 1}
# If the object does not implement `Eq`, a compile error will occur
print! {1.0, 1.0} # compile error