pyrefly
pyrefly copied to clipboard
Incorrect understanding of `global` in inner function
Describe the Bug
Minimal repro:
x: int = 1
def outer():
x: str = ""
def inner():
global x
reveal_type(x)
Expected: Reveals str
Actual:
- Found
x, but it was not the global scope - Reveals
str
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response