[ty] Propagate nested ParamSpec specializations#25766
Draft
dhruvmanila wants to merge 2 commits into
Draft
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 92.23%. The percentage of expected errors that received a diagnostic held steady at 87.42%. The number of fully passing files held steady at 92/134. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
0 | 2 | 0 |
| Total | 0 | 2 | 0 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Raw diff:
openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/core/bookshelves.py:174:53 error[invalid-argument-type] Argument to bound method `AsyncBridge.wrap` is incorrect: Expected `(**_P@staticmethod) -> Coroutine[Any, Any, None]`, found `def add_solr_works_async(readinglog_items, fields: Iterable[str] | None = None) -> CoroutineType[Any, Any, None]`
zulip (https://github.com/zulip/zulip)
- zerver/management/commands/runtornado.py:100:35 error[invalid-argument-type] Argument to function `sync_to_async` is incorrect: Expected `(**_P@push_async_callback) -> None`, found `def remove_signal_handlers() -> None`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParamSpecmappings until after argument inferenceParamSpecspecializations through return types to outer generic callsParamSpecargumentsRoot cause
The legacy specialization builder keeps the first mapping inferred for a
ParamSpec. Bidirectional inference installed the symbolic mapping from the outer call's return context before processing the inner call's arguments, so the later concrete argument-derived mapping was discarded. Adding the contextual mapping last makes it a fallback while allowing the concrete specialization to flow through the inner return type into the outer call.Validation
invalid-argument-typefalse positive: ParamSpec not propagated through composed higher-order functions ty#3691cargo test -p ty_python_semanticwith snapshot-update environment variablescargo clippy --workspace --all-targets --all-features -- -D warningsuvx prek run --files crates/ty_python_semantic/src/types/call/bind.rs crates/ty_python_semantic/resources/mdtest/bidirectional.md crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspec.mdCloses astral-sh/ty#3691