False negative: potentially unbound instance attribute doesn't trigger possibly-undefined
error
#17837
Labels
bug
mypy got something wrong
possibly-undefined
error
#17837
Bug Report
When enabling the possibly-undefined error code, a potentially undefined instance attribute doesn't trigger the error, while a potentially unbound variable does.
To Reproduce
Also available as mypy Playground, but cannot enable
enable_error_code = possibly-undefined
there.Expected Behavior
A
possible-undefined
error should be reported for line 11 as well, e.g.:Actual Behavior
No error reported for line 11.
Your Environment
--enable-error-code=possibly-undefined
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: