Describe the Bug
The following code fails to typecheck with pyrefly v0.54.0:
from typing import Sequence
def f(x: Sequence[int]) -> tuple[int, ...]:
if isinstance(x, tuple):
return x
return tuple(x)
$ uv run pyrefly check tmp.py
ERROR Returned type `tuple[*Sequence[int]]` is not assignable to declared return type `tuple[int, ...]` [bad-return]
--> tmp.py:5:16
|
5 | return x
| ^
|
INFO 1 error
Sandbox Link
sandbox link
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
The following code fails to typecheck with pyrefly v0.54.0:
Sandbox Link
sandbox link
(Only applicable for extension issues) IDE Information
No response