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

eval nil > 1 returns true #23

Closed
praveen-tt opened this issue Apr 21, 2019 · 2 comments
Closed

eval nil > 1 returns true #23

praveen-tt opened this issue Apr 21, 2019 · 2 comments
Labels

Comments

@praveen-tt
Copy link

I am accessing a map or struct fields in expression string, and in case field is not present in map or struct and if compared like Person.Age > 30 then return true.

Reduced issue is "nil > somevalue" return true.

@generikvault
Copy link
Collaborator

Yeah nil < 30 is not defined but the lexical order "nil" < "30" is and the values are automatically converted into string.
In this case it's really undesirable.

generikvault added a commit that referenced this issue May 3, 2019
…e-#23

#23 removed automatic nil to string convertion in operators
@generikvault
Copy link
Collaborator

"nil > somevalue" returns an error know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants