Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Supress "Replace '?:'-operator with '??'" suggestion #35

Closed
witcher112 opened this issue May 21, 2016 · 1 comment
Closed

Supress "Replace '?:'-operator with '??'" suggestion #35

witcher112 opened this issue May 21, 2016 · 1 comment
Milestone

Comments

@witcher112
Copy link

Hello!

As Unity explains:

When you do this in Unity:
if (myGameObject == null) {}

It behaves inconsistently with the ?? operator, which also does a null check, but that one does a pure c# null check, and cannot be bypassed to call our custom null check.

Source: http://blogs.unity3d.com/2014/05/16/custom-operator-should-we-keep-it

This suggestion might mislead the programmer while comparing UnityEngine.Objects.
Would it be possible to supress it?

Thanks in advance!

PS. Huge thanks for this amazing utility 😄 !

@citizenmatt
Copy link
Member

Rider 2017.3 no longer suggests to convert to ?? or ?., and Rider 2018.1 will have a warning if you try and use these operators on a type deriving from UnityEngine.Object.

@citizenmatt citizenmatt added this to the Rider 2018.1 milestone Feb 20, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants