Closed
Description
This test case fails in fine-grained incremental mode, though the code is okay in batch mode:
[case testRefreshPartialSpanningScopes]
import a
a.x
class A:
x = None
def f(self) -> None:
a.x
self.x = '' # Incompatible types in assignment (expression has type "str",
# variable has type "None")
[file a.py]
x = 0
[file a.py.2]
x = ''
The type of attribute A.x
is derived from information in two scopes (class body and method f
), and this logic fails in fine-grained incremental mode.
The best fix might be to require an annotation for x
in class body.