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

RCS1213 triggered when member is passed from primary constructor to base constructor #1342

Closed
gtbuchanan opened this issue Dec 26, 2023 · 0 comments · Fixed by #1343
Closed

Comments

@gtbuchanan
Copy link

gtbuchanan commented Dec 26, 2023

Product and Version Used:
Roslynator 4.7.0

Steps to Reproduce:

  1. Create a class with a primary constructor that inherits from another class with a constructor that has arguments.
  2. Call the base constructor from the primary constructor, passing a member of the class as a parameter.

Actual Behavior:

using System;

internal abstract class BaseClass(Action action)
{
    public Action Action { get; } = action;
}

internal sealed class ChildClass() : BaseClass(DoAction)
{
    private static void DoAction() // BUG: RCS1213 triggered here
    {
    }
}

Expected Behavior:
RCS1213 should not be triggered.

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