Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA1019 Incorrectly Reported #7442

Open
TonyValenti opened this issue Oct 10, 2024 · 0 comments
Open

CA1019 Incorrectly Reported #7442

TonyValenti opened this issue Oct 10, 2024 · 0 comments

Comments

@TonyValenti
Copy link

Analyzer

Diagnostic ID: CA1019: CA1019: Define accessors for attribute arguments

Analyzer source

SDK: .NET 8.0
Version: .NET 8.0

<LangVersion>preview</LangVersion>

Describe the bug

CA1019 looks for a property that matches the Name AND Type of the member. It should just look for the name and ignore the type.

Steps To Reproduce

    [AttributeUsage(validOn: AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
    public class DynamicallyIncludesAttribute : Attribute {

        public ImmutableArray<Type> Types { get; }

        public DynamicallyIncludesAttribute(params IEnumerable<Type> Types) {
            this.Types = [.. Types];
        }
    }

Expected behavior

CA1019 is not reported in the above code.

Actual behavior

CA1019 is reported in the above code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant