R# 2019.3 regression: argument validation

I annotate parameters which do not accept null with the [NotNull] attribute. However, since this does not prevent a caller from passing in a null value, I also validate the parameters. For example:

public void Foo([NotNull] Bar baz)
{
if (baz is null) throw new ArgumentNullException(nameof(baz));
...

In 2019.2 and earlier, this worked perfectly.

I've just updated to 2019.3, and R# is now showing an "expression is always false" warning on every "is null" test.

2 comments
Comment actions Permalink
Official comment

Hello Richard,

 

thank you for the feedback.

I've filed an issue - https://youtrack.jetbrains.com/issue/RSRP-477401.

We are planning its fix in ReSharper 2019.3.1.

Thank you.

Please sign in to leave a comment.