def example(a: list[int] | None, b: list[int] | None) -> list[int]:
match (a, b):
case (None, None):
return []
case (_, None):
return a # error: int | None not assignable to list[int]
case (None, _):
return b # error: int | None not assignable to list[int]
case _:
return a + b # error: int | None not assignable to list[int]
Describe the Bug
Pyrefly emits false positives on this code:
(sandbox). Pyright accepts it.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response