Skip to content

Fixer for IDE0251 results in poorly formatted code #69876

@reflectronic

Description

@reflectronic

Version: Visual Studio 17.8.0 Preview 1.0

Reproduction steps: Consider this struct definition.

struct S
{
    public int M;

    public int Z
    {
        get => M;
        set => M = value;
    }
}

On the get keyword, a fixer for "IDE0251: Member can be made 'readonly'" is available. Use the fixer.

Actual behavior: The property definition will then look like:

struct S
{
    public int M;

    public int Z
    { readonly get => M;
        set => M = value;
    }
}

Expected behavior: The property definition should look like:

struct S
{
    public int M;

    public int Z
    { 
        readonly get => M;
        set => M = value;
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions