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

Add NumberLiteral#zero? #10248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Jan 13, 2021

@asterite
Copy link
Member

I really don't see a need for this. Let's just remove the unused method for now.

@straight-shoota
Copy link
Member

I agree to remove it. With #10462 you can just use {% number.to_i == 0%}. In the macro language we don't need a convenient short cut for that.

@straight-shoota
Copy link
Member

With #10802 merged, the workaround proposed in my previous comment does not exactly apply: NumberLiteral#to_number returns 0 or 0.0 depending on whether it's an int or float literal. So equality with zero is not as trivial. But unless there is a reasonable use case, I think this should be closed.

@Sija Sija force-pushed the add-number-literal-zero branch from 3d84d00 to cf90cea Compare September 24, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants