add TODO for Never/Unknown

This commit is contained in:
Douglas Creager 2025-12-15 13:55:31 -05:00
parent 0966bca3f1
commit 56b6f26f7b
2 changed files with 8 additions and 2 deletions

View File

@ -526,7 +526,10 @@ def test_seq(x: Sequence[T]) -> Sequence[T]:
def func8(t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()]):
reveal_type(test_seq(t1)) # revealed: Sequence[int | float | complex | list[int]]
reveal_type(test_seq(t2)) # revealed: Sequence[int | str]
reveal_type(test_seq(t3)) # revealed: Sequence[Never]
# TODO: The return type here is wrong, because we end up creating a constraint (Never ≤ T),
# which we confuse with "T has no lower bound".
# TODO: revealed: Sequence[Never]
reveal_type(test_seq(t3)) # revealed: Sequence[Unknown]
```
### `__init__` is itself generic

View File

@ -464,7 +464,10 @@ def test_seq[T](x: Sequence[T]) -> Sequence[T]:
def func8(t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()]):
reveal_type(test_seq(t1)) # revealed: Sequence[int | float | complex | list[int]]
reveal_type(test_seq(t2)) # revealed: Sequence[int | str]
reveal_type(test_seq(t3)) # revealed: Sequence[Never]
# TODO: The return type here is wrong, because we end up creating a constraint (Never ≤ T),
# which we confuse with "T has no lower bound".
# TODO: revealed: Sequence[Never]
reveal_type(test_seq(t3)) # revealed: Sequence[Unknown]
```
### `__init__` is itself generic