Closed kwesolowski closed 8 years ago
@kwesolowski: You are right, ReSharper's "Base declaration has the same annotation" redundant code warning competes with Implicit Nullability's "Implicit NotNull conflicts with nullability in super type".
There are two reasons why in the projects where we use Implicit Nullability we ignore ReSharper's "Base declaration has the same annotation" warning (and changed its severity level to "Hint").
[CanBeNull]
annotations in method overrides (otherwise it would inject null checks although the base method is decorated with [CanBeNull]
).[CanBeNull]
information also in the derived types.Of course, if both points do not apply, you can change the "Implicit NotNull conflicts with nullability in super type" warning's severity to "Hint", or "Do not show".
As a new feature in version 3.0.0, Implicit Nullability now filters ReSharper's AnnotationRedundancyInHierarchy
("Base declaration has the same annotation") highlighting specifically for code elements with enabled implicit nullability. So you can enable the inspection again (to get it for code elements without enabled implicit nullability).
It is assumed already by ReSharper that when interface/abstract/overriden method has
[NotNull]
/[CanBeNull]
annotations then inheriting types should conform (and repeating attribute is grayed out as redundant).So am I missing something or I should just disable this inspection?