Avoid reporting CA1033 for interfaces#50339
Conversation
| [Fact] | ||
| public async Task CA1033InterfaceWithDefaultImplementationsCSharpAsync() | ||
| { | ||
| await VerifyCS.Test.Create(""" |
There was a problem hiding this comment.
What about using raw string literals? I think it makes tests more readable. Is it acceptable to update other tests only in this file for now? Or should all tests in the project be updated at once?
| public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.CSharp7_3; | ||
| public LanguageVersion LanguageVersion { get; set; } = DefaultLanguageVersion; | ||
|
|
||
| public static Test Create([StringSyntax("C#-test")] string source, LanguageVersion languageVersion = DefaultLanguageVersion, params ReadOnlySpan<DiagnosticResult> expected) |
There was a problem hiding this comment.
I also proposed these changes a separate PR #50342 with a detailed description
|
@dotnet/dotnet-analyzers |
|
Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label. |
The lack of activity is just waiting for a review so the bot just adds noise. |
This PR fixes #50341
Changes
Fixed
InterfaceMethodsShouldBeCallableByChildTypesAnalyzerso that CA1033 is not reported for interfaces with default implementations, for example:Added unit tests.