We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3807423 commit 2b1bba2Copy full SHA for 2b1bba2
1 file changed
test-data/unit/issue_scope.test
@@ -0,0 +1,17 @@
1
+[case testScopeOptionalIntResolution]
2
+from typing import Optional
3
+
4
+x: Optional[int] = None
5
+y: Optional[int] = None
6
7
+def f() -> None:
8
+ x = 1
9
+ y = 1
10
+ class C:
11
+ reveal_type(x) # should be int
12
+ reveal_type(y) # should be Optional[int]
13
+ x = 2
14
15
+[out]
16
+note: Revealed type is "builtins.int"
17
+note: Revealed type is "Union[builtins.int, None]"
0 commit comments