-
Notifications
You must be signed in to change notification settings - Fork 280
Labels
typecheckingusabilityUsability & readiness issues identified with running Pyrefly on top OSS projectsUsability & readiness issues identified with running Pyrefly on top OSS projects
Description
Describe the Bug
Minimal repro:
# Return type is a union of tuples
def parse_resource_id() -> tuple[str, str] | tuple[None, None]:
...
# After destructuring, kind: str | None. The `not in` guard should narrow
# it to str, but pyrefly does not narrow via `not in`.
def lookup_resource(registry: dict[str, str]) -> str | None:
kind, _obj_id = parse_resource_id()
if kind not in registry:
return None
return registry[kind] # Pyrefly: str | None not assignable to str keyMypy, Pyright, and Ty all choose to remain silent on the error.
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
typecheckingusabilityUsability & readiness issues identified with running Pyrefly on top OSS projectsUsability & readiness issues identified with running Pyrefly on top OSS projects