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

[Bug] Bad precedence for device objects in ternary operator #1681

Open
laurensvalk opened this issue Jun 17, 2024 · 0 comments
Open

[Bug] Bad precedence for device objects in ternary operator #1681

laurensvalk opened this issue Jun 17, 2024 · 0 comments
Labels
bug Something isn't working software: pybricks-blocks Issues with blocks and code generation

Comments

@laurensvalk
Copy link
Member

Describe the bug
A ternary operator (or any operation) in the object getter block does not get parentheses.

To reproduce
image

Expected behavior

The last line should be:

(left if condition else right).stop()
@laurensvalk laurensvalk added bug Something isn't working software: pybricks-blocks Issues with blocks and code generation labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software: pybricks-blocks Issues with blocks and code generation
Projects
None yet
Development

No branches or pull requests

1 participant