Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[red-knot] Fix: Infer type for typing.Union[..] tuple expression #14510

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Nov 21, 2024

Summary

Fixes a panic related to sub-expressions of typing.Union where we fail to store a type for the int, str tuple-expression in code like this:

x: Union[int, str] = 1

relates to my comment on #14499.

Test Plan

New corpus test

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@sharkdp sharkdp merged commit f684b6f into main Nov 21, 2024
20 checks passed
@sharkdp sharkdp deleted the david/fix-union-type-panic branch November 21, 2024 10:49
@sharkdp sharkdp added the red-knot Multi-file analysis & type inference label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant