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

Respect async expressions in comprehension bodies #11219

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

We weren't recursing into the comprehension body.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 30, 2024
}
_ => preorder::walk_expr(self, expr),
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No change to this method, just reordered to match trait definition.)

fn visit_comprehension(&mut self, comprehension: &'a ast::Comprehension) {
if comprehension.is_async {
self.found_await_or_async = true;
} else {
preorder::walk_comprehension(self, comprehension);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix.

@charliermarsh charliermarsh marked this pull request as ready for review April 30, 2024 18:31
@charliermarsh charliermarsh enabled auto-merge (squash) April 30, 2024 18:31
@charliermarsh charliermarsh merged commit 414990c into main Apr 30, 2024
19 checks passed
@charliermarsh charliermarsh deleted the charlie/comp branch April 30, 2024 18:38
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant