Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ajout du test unitaire issue_scope.test
  • Loading branch information
ines-bg committed Oct 9, 2025
commit 2b1bba258d3678b3152476e52bd01040337c4ca3
17 changes: 17 additions & 0 deletions test-data/unit/issue_scope.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[case testScopeOptionalIntResolution]
from typing import Optional

x: Optional[int] = None
y: Optional[int] = None

def f() -> None:
x = 1
y = 1
class C:
reveal_type(x) # should be int
reveal_type(y) # should be Optional[int]
x = 2

[out]
note: Revealed type is "builtins.int"
note: Revealed type is "Union[builtins.int, None]"