Open WeihanLi opened 9 months ago
What do you mean by default implementation?
It's recommending that, for performance, you pass the concrete type. I imagine that doing so does result in more performant code.
Note, you always have the ability to to silence specific warnings at your chosen level, weather that be a line of code, file, assembly or with a properties file to cover multiple projects at once.
I don't see how changing the warning or modifying it's behaviour would be of benefit, you just need to make a judgement call and decide if it is relevant to you or not.
What do you mean by default implementation?
When using the interface default implementation method, we have to use the interface instead
Although we could suppress the diagnostic warning(I also do this way in my code), while think maybe we could improve the analyzer logic for a better developer experience
Apologies, I see now.
Maybe this should be moved to the Roslyn issues? Please help move the issue if needed, thanks very much
@jaredpar Do you have access to transfer this to https://github.com/dotnet/roslyn-analyzers?
Describe the bug
CA1859
analyzer in .NET 9 SDK may be too aggressive, think it should not report when interface default implemented method usedApologize if this is not the correct place, please help move the issue to the Roslyn or runtime repo if needed, thanks very much.
To Reproduce
sample code as below:
It works fine in .NET 8, while when updated to .NET 9 SDK, it reports
A full runnable project here: https://github.com/WeihanLi/dotnet-exec/tree/19b9865319c5b2e21a46c55ad8ff4dd7bd3e609d
Exceptions (if any)
Further technical details
dotnet --info