[ty] Fix false positives for legacy ParamSpecs inside Callable type expressions (#18426)

This commit is contained in:
Alex Waygood 2025-06-02 14:10:00 +01:00 committed by GitHub
parent e2d96df501
commit 47698883ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 30 deletions

View file

@ -264,10 +264,9 @@ from typing_extensions import ParamSpec
P2 = ParamSpec("P2")
# TODO: Not an error; remove once `ParamSpec` is supported
# error: [invalid-type-form]
# TODO: argument list should not be `...` (requires `ParamSpec` support)
def _(c: Callable[P2, int]):
reveal_type(c) # revealed: (...) -> Unknown
reveal_type(c) # revealed: (...) -> int
```
## Using `typing.Unpack`