Skip to content

Unexpected SA1513 before init accessor #3658

@bjornhellander

Description

@bjornhellander

The following code illustrates a difference between how SA1513 treats set accessors and init accessors:

class MyClass
{
    public int X
    {
        get
        {
            return 0;
        } // <-- Does NOT trigger SA1513
        set
        {
        }
    }

    public int Y
    {
        get
        {
            return 0;
        } // <-- Triggers SA1513
        init
        {
        }
    }
}

I expect SA1513 to not trigger before init accessors, just like it does not trigger before set accessors.
Note: SA1516 triggers in both cases, like it should.

Tested with 1.2.0-beta.435

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions