check_syntax_error(self, "x: int: str")
check_syntax_error(self, "def f():\n"
" nonlocal x: int\n")
+ check_syntax_error(self, "def f():\n"
+ " global x: int\n")
+ check_syntax_error(self, "x: int = y = 1")
+ check_syntax_error(self, "z = w: int = 1")
+ check_syntax_error(self, "x: int = y: int = 1")
# AST pass
check_syntax_error(self, "[x, 0]: int\n")
check_syntax_error(self, "f(): int\n")
check_syntax_error(self, "def f():\n"
" global x\n"
" x: int\n")
+ check_syntax_error(self, "def f():\n"
+ " x: int\n"
+ " nonlocal x\n")
+ check_syntax_error(self, "def f():\n"
+ " nonlocal x\n"
+ " x: int\n")
def test_var_annot_basic_semantics(self):
# execution order