Skip to content

Handle left Token being null in == and !=. #1802

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

Closed
wants to merge 2 commits into from
Closed

Handle left Token being null in == and !=. #1802

wants to merge 2 commits into from

Conversation

andrewimcclement
Copy link
Contributor

@andrewimcclement andrewimcclement commented Jul 19, 2022

Fixes #1797. This seems the simplest change to get things working correctly.

Marking as sealed is important to avoid potential complications with derived classes.

Personally I find it fairly natural to have == and != defined for something implementing IEquatable - it provides a natural way to check for equality including nulls.

@KalleOlaviNiemitalo
Copy link

This is no longer needed because #1797 was fixed by #1842.

@jonsequitur
Copy link
Contributor

Thanks, @andrewimcclement. The bug was fixed elsewhere. Sealing Token is a reasonable thing to do. If you'd like to resubmit that change, I'd be happy to merge it.

@andrewimcclement andrewimcclement deleted the aim_token_eq_operator branch October 19, 2022 09:50
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

Successfully merging this pull request may close these issues.

NullReferenceException from Token.operator !=
3 participants