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