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

Warning CA1061 seems inappropriate #7562

Open
SoftCircuits opened this issue Feb 4, 2025 · 0 comments
Open

Warning CA1061 seems inappropriate #7562

SoftCircuits opened this issue Feb 4, 2025 · 0 comments

Comments

@SoftCircuits
Copy link

I'm getting a warning with a derived class. The base class I'm deriving from contains:

public void Write(params string?[] columns) { ... }
public void Write(IEnumerable<string?> columns) { ... }

And my derived class contains:

public new void Write(params string?[] columns) => base.Write(FilterColumns(columns));
public new void Write(IEnumerable<string?> columns) => base.Write(FilterColumns(columns));

But the second Write() method in my class gives a warning.

Change or remove 'RailtraxCore.TableColumns.HiddenColumnsCsvWriter.Write(System.Collections.Generic.IEnumerable<string?>)' because it hides a more specific base class method: 'SoftCircuits.CsvParser.CsvWriter.Write(params string?[])'

I don't understand the reason for this. Yes, the base class has the more specific version. But it won't be called if IEnumerable<string> is the parameter type. So why would this be a warning?

@CyrusNajmabadi CyrusNajmabadi transferred this issue from dotnet/roslyn Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant