You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
477 B
17 lines
477 B
x : int = 0
|
|
y : int = 5
|
|
z : Foo = None
|
|
class Foo(object):
|
|
x : int = 3
|
|
def foo(x : int) -> int:
|
|
y : str = "test"
|
|
def foo2() -> str:
|
|
nonlocal y
|
|
return y
|
|
nonlocal x # The reference compiler prioritized for duplicate declaration
|
|
# error and stopped compilation.
|
|
# But our implementation prioritized this for an invalid nonlocal
|
|
# and recovered the complation process.
|
|
return x
|
|
x = 1 and 2
|
|
foo(y, 5) |