mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
20 lines
338 B
Python
20 lines
338 B
Python
_ = 1 as Str # ERR
|
|
_ = 1 as Never # ERR
|
|
|
|
n = 1
|
|
_ = n.times!
|
|
i = n as Int
|
|
_ = i.times! # ERR
|
|
|
|
v: Array!(Int or Str, 2) = ![1, 2]
|
|
v.push! 1 # OK
|
|
v.push! "a" # ERR
|
|
v.push! None # ERR
|
|
|
|
v2 as Array!(Int or Str, 2) = ![1, 2]
|
|
v2.push! 1 # OK
|
|
v2.push! "a" # OK
|
|
v2.push! None # ERR
|
|
|
|
v3 = v2 as Array!(Int or Str or NoneType, _)
|
|
v3.push! None # OK
|