Skip to content

[used before def] handle walrus declaration in match subject correctly#14665

Merged
JukkaL merged 2 commits intopython:masterfrom
ilinum:fix-match-walrus
Feb 10, 2023
Merged

[used before def] handle walrus declaration in match subject correctly#14665
JukkaL merged 2 commits intopython:masterfrom
ilinum:fix-match-walrus

Conversation

@ilinum
Copy link
Copy Markdown
Collaborator

@ilinum ilinum commented Feb 9, 2023

The subject needs to be processed outside of match statement and not as part of the first branch.

Fixes #14659.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JukkaL JukkaL merged commit 4261e51 into python:master Feb 10, 2023
ilinum added a commit to ilinum/mypy that referenced this pull request Feb 10, 2023
python#14665)

The subject needs to be processed outside of match statement and not as
part of the first branch.

Fixes python#14659.
JukkaL pushed a commit that referenced this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

used-before-def incorrectly flagged when using match/case with a walrus operator

3 participants