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

RCS1074 triggered when constructor has attributes #962

Closed
gtbuchanan opened this issue Oct 13, 2022 · 2 comments · Fixed by #968
Closed

RCS1074 triggered when constructor has attributes #962

gtbuchanan opened this issue Oct 13, 2022 · 2 comments · Fixed by #968

Comments

@gtbuchanan
Copy link

gtbuchanan commented Oct 13, 2022

Product and Version Used:
Roslynator 4.1.1

Steps to Reproduce:

  1. Create a class or record with an empty constructor
  2. Add an attribute (e.g. ReSharper's UsedImplicitlyAttribute) to the constructor

Actual Behavior:

public sealed class MyClass
{
    [UsedImplicitly]
    public MyClass() // Triggers RCS1074
    {
    }
}

Expected Behavior:
RCS1074 should not be triggered when an attribute is added to the empty constructor because this makes the constructor differ from the default constructor.

@josefpihrt
Copy link
Collaborator

Hi,

can you please tell me what is the full name the attribute (the name + containing namespace)?

@gtbuchanan
Copy link
Author

@josefpihrt It is JetBrains.Annotations.UsedImplicitlyAttribute. You can find it here.

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

Successfully merging a pull request may close this issue.

2 participants