Short reproduction of the issue:
# test.py
def f(i):
return a if (a := round(i)) - 1 else a + 1
print(f"result is {f(1.0)}")
This executes correctly:
$ python test.py
result is 2
But pyrefly raises an error (using v0.52.0):
$ pyrefly check test.py
ERROR `a` is uninitialized [unbound-name]
--> test.py:3:40
|
3 | return a if (a := round(i)) - 1 else a + 1
| ^
|
INFO 1 error
Sandbox Link
sandbox link
(Only applicable for extension issues) IDE Information
No response
Short reproduction of the issue:
This executes correctly:
But pyrefly raises an error (using v0.52.0):
Sandbox Link
sandbox link
(Only applicable for extension issues) IDE Information
No response