Code inspection: Unsafe context declaration is redundant
This inspection reports an unsafe context when it is not needed. This can happen when the declaration or statement does not contain any unsafe code, or when the code is already inside another unsafe context.
Example
unsafe class C
{
public int GetValue() => 0;
}
class C
{
public int GetValue() => 0;
}
Quick-fix
The quick-fix removes the redundant unsafe modifier or block.
13 April 2026