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

Generator expression handles "while" modifier incorrectly #195

Open
masonwheeler opened this issue Oct 25, 2018 · 0 comments
Open

Generator expression handles "while" modifier incorrectly #195

masonwheeler opened this issue Oct 25, 2018 · 0 comments

Comments

@masonwheeler
Copy link
Contributor

Boo allows Python-style generator expressions, using the StatementModifier AST node for the filter part. StatementModifier contains three possible modifiers: if, unless, and while.

In GeneratorExpressionProcessor.CreateMoveNext, it processes a generator expression and, if it has a filter, turns that into an if statement if the StatementModifier type is If, or an unless statement otherwise, meaning that it's possible to write a generator expression using the while modifier, which the compiler will then proceed to treat as an unless modifier.

No compile error is raised stating that the while modifier is not valid here; the compiler silently generates bad code.

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

No branches or pull requests

1 participant