pyrefly
pyrefly copied to clipboard
Do not warn on bad return for infinite loops
Minimal repro:
def derp(x: int) -> bool: ...
def test(y: int) -> int:
while True:
if derp(y):
return 42
else:
y += 1
Expected: No error
Actual: Function declared to return int, but one or more paths are missing an explicit return [bad-return]
Sandbox url: https://pyrefly.org/sandbox/?code=CYUwZgBKBOAOAUAPAXBAlgOwC4EoIFoA+CAIwHsyAbVAOjoChRIsQBnLeAT1U1wON7J6EERADuACzSUQEACrQAriCGi16SDASccq9fuggsi6BggAWAEzD9EEJVYqbt0ZwgBqALwQAjEA
I think this is fixed?
Sandbox still shows the same error to me.
Looks like it is now fixed, I see no errors in sandbox