Skip to content

Commit 2b1bba2

Browse files
committed
ajout du test unitaire issue_scope.test
1 parent 3807423 commit 2b1bba2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test-data/unit/issue_scope.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)