Skip to content

BUG: CC0035 doesn't respect readonly #943

@paulomorgado

Description

@paulomorgado
private bool isDisposed;

When the fix is applied to:

public class C
{
    private readonly string b;
    private string a;
}

The code is changed to:

public class C
{
    private string a;
    private readonly string b;
}

But it should not change because "A readonly field is positioned beneath a non-readonly field": https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1214.md
readonly

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions