Repository navigation
Conversation
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D132914900. (Because this pull request was imported automatically, there will not be any future comments.) |
This comment has been minimized.
This comment has been minimized.
The synthetic literal used the whole module's range, so its type trace shadowed an expression spanning the whole module (a single expression without a trailing newline): range-based type queries returned `Literal[False]` for it. An empty range, as the empty-bindings constructor already uses, cannot collide with a real expression. Fixes pyrefly-org#5670 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KalininDL
force-pushed
the
fix-functools-wrapper-mutation-range
branch
from
November 19, 2026 07:33
218475f to
d7dd2a0
Compare
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This branch has not been deployed
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
The synthetic
functoolswrapper mutation literal was bound with the whole module's range, so its type trace shadowed an expression spanning the whole module (a single expression without a trailing newline). For example,typeServer/getComputedTypeon[1, 2, 3]returnedLiteral[False]instead oflist[int]. This binds the literal with an empty range, as the empty-bindings constructor already does. Reported errors are unchanged.Fixes #5670
Test Plan
test_get_computed_type_expression_spanning_whole_moduleto get_type_queries.rsIt fails before the fix and passes after
cargo test --release -p pyrefly --lib(10960 passed, 0 failed) and lint pass.