erg/tests/should_err/dict.er
Shunsuke Shibayama 07b98112a7 fix: dict type bug
2024-10-19 03:11:14 +09:00

15 lines
378 B
Python

for! {"a": 1, "b": 2}.values(), s =>
print! "key: " + s # ERR
for! {"a": 1, "b": 2}.keys(), i =>
print! i + 0 # ERR
dic as {Nat: Int} = {1: -1}
_ = dic[-1] # ERR
l as List! {Str: Int} = ![{"a": 1}]
l.push!({"b": 2}) # OK
l.push!({1: "a"}) # ERR
_: Mapping(Int, Str) = {1: "a", 2: "b"}
_: Iterable(Int) = {1: "a", 2: "b"}
_: Mapping(Str, Int) = {1: "a", 2: "b"} # ERR