-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
False PositiveRule IS triggered when it shouldn't be.Rule IS triggered when it shouldn't be.
Milestone
Description
Description
S2094 triggers a false positive when using records with marker interface, while it does not when using a class.
Repro steps
When using this code, I get a S2094 on ImplementsMarker.
interface IMarker { }
record ImplementsMarker : IMarker { }When using this code, I don't get the S2094.
interface IMarker { }
class ImplementsMarker : IMarker { }Expected behavior
I expect to not have the S2094 warning.
Actual behavior
S2094 is raised. I know that records are special classes, and I could understand that the behavior is different, but if that is the case i did not find why.
Known workarounds
Use a class instead of a record.
Related information
- C# Plugins version: 7.0.0.74072
- Visual Studio version: 17.6.4
- dotnet version: 7.0.305
- Operating System: Windows 11
Metadata
Metadata
Assignees
Labels
False PositiveRule IS triggered when it shouldn't be.Rule IS triggered when it shouldn't be.