Code inspection: 'void' method is annotated with the [Pure] attribute
This inspection reports void methods annotated with [Pure]. A pure method is expected to return a value that depends only on its inputs and has no observable side effects. A void method cannot return such a value, so the annotation is usually misleading.
Example
using JetBrains.Annotations;
class C
{
[Pure]
public void UpdateState()
{
}
}
class C
{
[Pure]
public int GetState()
{
return 42;
}
}
Quick-fix
Remove the attribute, or change the method so it returns the computed value instead of being void.
01 April 2026