File tree 2 files changed +33
-0
lines changed 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -2461,3 +2461,13 @@ x: C
2461
2461
reveal_type(x) # E: Revealed type is '__main__.C[Any]'
2462
2462
[out]
2463
2463
[out2]
2464
+
2465
+ [case testNewAnalyzerClassVariableOrdering]
2466
+ def foo(x: str) -> None: pass
2467
+
2468
+ class Something:
2469
+ def run(self) -> None:
2470
+ foo(self.IDS[0]) # E: Argument 1 to "foo" has incompatible type "int"; expected "str"
2471
+
2472
+ IDS = [87]
2473
+ [builtins fixtures/list.pyi]
Original file line number Diff line number Diff line change @@ -8969,3 +8969,26 @@ class B: ...
8969
8969
[builtins fixtures/list.pyi]
8970
8970
[out]
8971
8971
==
8972
+
8973
+ [case testClassVariableOrderingRefresh]
8974
+ # flags: --new-semantic-analyzer
8975
+ from b import bar
8976
+
8977
+ def foo(x: str) -> None: pass
8978
+
8979
+ class Something:
8980
+ def run(self) -> None:
8981
+ bar()
8982
+ foo(self.IDS[0])
8983
+
8984
+ IDS = [87]
8985
+
8986
+ [file b.py]
8987
+ def bar() -> int: return 0
8988
+ [file b.py.2]
8989
+ def bar() -> str: return '0'
8990
+ [builtins fixtures/list.pyi]
8991
+ [out]
8992
+ main:9: error: Argument 1 to "foo" has incompatible type "int"; expected "str"
8993
+ ==
8994
+ main:9: error: Argument 1 to "foo" has incompatible type "int"; expected "str"
You can’t perform that action at this time.
0 commit comments