Skip to main content

RCS1169: Make field read-only

Properties

PropertyValue
Default SeverityInfo
Minimum language version-

Examples

Example #1

diagnostic.cs
public class Foo
{
private int _f;

public Foo()
{
_f = 0;
}
}
fix.cs
private readonly int _f;

Configuration

.editorconfig
# Enable code analysis to detect Unity-specific code
roslynator_unity_code_analysis.enabled = true|false

Applies to