-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve block unreachablility when checking function definitions wit…
…h constrained TypeVars (#18217) Fixes #18210 When checking function definitions with constrained type variables (i.e. type variables with value restrictions), mypy expands the function definition for each possible type variable value. However, blocks in the expanded function definitions have their `is_unreachable` reset to `False`, which leads to spurious errors in blocks that were marked as unreachable during semantic analysis. This PR preserves the value of `is_unreachable` on blocks in the expanded function definitions.
- Loading branch information
1 parent
9dad464
commit e666217
Showing
3 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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