RCS1169: Make field read-only
Properties
Property | Value |
---|---|
Default Severity | Info |
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