Closed cmeeren closed 7 years ago
Thanks for your report. Unfortunately there isn't much I can do about it because it has to be solved within R#.
I created a bug report: https://youtrack.jetbrains.com/issue/RSRP-464760. Note that it happens even without Implicit Nullability for inherited [NotNull]
s.
At the moment, I can only suggest suppression comments or old-style (pre C#7) null checks as workarounds.
Thanks! I'll follow that bug report then.
Fixed in R# 2017.2
Please see the following two images. In the first image, the parameter
id
is implicitlyNotNull
. ReSharper dims the null check and says it's unnecessary becauseid
is never null. In the second image, I've added an explicit[NotNull]
annotation and everything works as expected. I would expect the behavior to be the same in the two cases.