mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +00:00
12 lines
303 B
Python
12 lines
303 B
Python
C = Class { .a = Array(Int) }
|
|
_ = C.new { .a = [1] } # OK
|
|
_ = C.new { .a = ["a"] } # ERR
|
|
|
|
D = Class { .a = Array(Int, 1) }
|
|
_ = D.new { .a = [1] } # OK
|
|
d = D.new { .a = [1, 2] } # OK
|
|
assert d.a[0] == "a" # ERR
|
|
|
|
E = Class { .a = Array(Int, 2) }
|
|
_ = E.new { .a = [1, 2] } # OK
|
|
_ = E.new { .a = [1] } # ERR
|