You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use EnsureArg.IsNotNull(parameter) - which is documented with [ValidatedNotNull]
After that call, do something like var _ = parameter.ToString();
Expectation:
parameter is known to not be null at the .ToString() call
Reality:
R# does not seem to recognize that (in 2018.2 at least).
I think I mistakenly believed R# would acknowledge ValidatedNotNull (or it used to), either way we can work around it if we are willing to add a ContractAnnotation [ContractAnnotation("=> parameter:notnull")] Which says if the method returns, parameter will be non-null.
The text was updated successfully, but these errors were encountered:
ndrwrbgs
added a commit
to ndrwrbgs/Ensure.That
that referenced
this issue
Nov 4, 2018
Steps:
var _ = parameter.ToString();
Expectation:
Reality:
I think I mistakenly believed R# would acknowledge ValidatedNotNull (or it used to), either way we can work around it if we are willing to add a ContractAnnotation
[ContractAnnotation("=> parameter:notnull")]
Which says if the method returns, parameter will be non-null.The text was updated successfully, but these errors were encountered: