JetBrains Rider 2026.1 Help

Code inspection: Nullability attribute used with declaration that cannot be directly referenced from other code

This inspection reports a nullability annotation that ReSharper cannot meaningfully observe at that declaration site. In practice, this means the attribute does not affect analysis because other code cannot reference that exact declaration shape in a useful way.

Example

A common case is applying [field: NotNull] to an auto-property field target.

using JetBrains.Annotations; public class Person { [NotNull] [field: NotNull] public string Name { get; } = "Alice"; }
using JetBrains.Annotations; public class Person { [NotNull] public string Name { get; } = "Alice"; }

Quick-fix

Remove the redundant nullability annotation.

29 March 2026