Skip to content

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

Merged
sharkdp merged 1 commit intomainfrom
david/fix-union-type-panic
Nov 21, 2024
Merged

[red-knot] Fix: Infer type for typing.Union[..] tuple expression#14510
sharkdp merged 1 commit intomainfrom
david/fix-union-type-panic

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

@github-actions
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
@sharkdp sharkdp deleted the david/fix-union-type-panic branch November 21, 2024 10:49
@sharkdp sharkdp added the ty 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

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant