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

null == null is false #152

Closed
odino opened this issue Jan 31, 2019 · 2 comments
Closed

null == null is false #152

odino opened this issue Jan 31, 2019 · 2 comments
Assignees
Milestone

Comments

@odino
Copy link
Collaborator

odino commented Jan 31, 2019

See #151

@odino odino added this to the 1.1.x milestone Jan 31, 2019
@odino odino self-assigned this Jan 31, 2019
@odino
Copy link
Collaborator Author

odino commented Feb 1, 2019

One more case: '{"a": null}'.json().a == null

@odino
Copy link
Collaborator Author

odino commented Feb 1, 2019

Just tested and the previous example is covered in #151.

odino referenced this issue Feb 1, 2019
```
myhash = {"some": "thing", "over": "the rainbow", "x": "y"}
some, over = myhash
echo(some) # "thing"
```

@ntwrick I had to revert one of your changes we introduced
when adding error lines etc. When we evaluate null literals
we always return a new object, and this means that when
you compare `null == null` that is `false` as they're 2
different objects. For now I reverted that line you changed
but maybe we could also think of adding a special case to
handle `==` with nulls. Problem is, you'd have to add another
special case for `!=` so I think it's probably easier to just
reuse the same object for nulls...what do you think?
@odino odino closed this as completed Feb 2, 2019
odino added a commit that referenced this issue Feb 2, 2019
odino added a commit that referenced this issue Feb 2, 2019
odino added a commit that referenced this issue Feb 2, 2019
odino added a commit that referenced this issue Feb 2, 2019
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