pyrefly
pyrefly copied to clipboard
Awaiting an `Awaitable[Any]` should not produce a `Var`
Describe the Bug
Minimal repro:
from typing import Any
async def foo() -> Any: ...
def bar(x: int, y: str) -> None: ...
async def test() -> None:
z = await foo() # Pyrefly currently produces a `Var` here, which gets affected by downstream code. This is wrong -- it should be Any
bar(z, z)
Expected: No error
Actual: Argument int is not assignable to parameter y with type str in function bar
Sandbox Link
https://pyrefly.org/sandbox/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoCCKcAUCQIYDOcKAxlACYCmwUwYYAFAJRQC0APkLEAXFAB0kks1YAjciE4APMahgAaKHDGUYIXoKgA5MCiZjJ4slRr0ZsJrp78hJsyJJQvUAF5QAvFDkAO7kSPjsXNye3vKKPpo+3EA
(Only applicable for extension issues) IDE Information
No response