Replies: 1 comment 1 reply
-
Sounds good. Feel free to open a pull request to add the attribute 🙂. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The code for
Node.IsInstanceValid
in C# is as follows, according to the reflector:One common use case of
IsInstanceValid
is to check whether an instance is not null and not disposed.However, if you use it this way:
This can be resolved by adding a
NotNullWhenAttribute
to theinstance
argument.This tells the C# compiler that if the method returns true, the instance cannot be null.
Beta Was this translation helpful? Give feedback.
All reactions