Closed
Description
Bug description
Create test.py
with the following content:
def f():
x: int
def g():
nonlocal x
x = 5
g()
print(x)
f()
Configuration
No response
Command used
pylint test.py
Pylint output
************* Module test
test.py:9:10: E0602: Undefined variable 'x' (undefined-variable)
------------------------------------------------------------------
Your code has been rated at 3.75/10 (previous run: 3.75/10, +0.00)
Expected behavior
There should be no errors reported.
Pylint version
pylint 2.12.1
astroid 2.9.0
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]
OS / Environment
No response
Additional dependencies
No response