Skip to content

Commit

Permalink
Fix analyzer RCS1203 (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt authored Nov 24, 2023
1 parent 7dfe531 commit 62a9d84
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix analyzer [RCS1124](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1124) ([PR](https://github.com/dotnet/roslynator/pull/1279))
- Fix analyzer [RCS0058](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0058) ([PR](https://github.com/dotnet/roslynator/pull/1281))
- Fix analyzer [RCS1163](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1163) ([PR](https://github.com/dotnet/roslynator/pull/1280))
- Fix analyzer [RCS1203](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1203) ([PR](https://github.com/dotnet/roslynator/pull/1282))

## [4.6.4] - 2023-11-24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public static void AnalyzerNamedTypeSymbol(
if (typeSymbol.IsImplicitlyDeclared)
return;

if (typeSymbol.IsAbstract)
return;

if (typeSymbol.TypeKind != TypeKind.Class)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ await VerifyNoDiagnosticAsync(@"
class Foo : Attribute
{
}
");
}

[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAttributeUsageAttribute)]
public async Task TestNoDiagnostic_AbstractAttribute()
{
await VerifyNoDiagnosticAsync(@"
using System;
public abstract class MyAttribute : Attribute
{
}
");
}
}

0 comments on commit 62a9d84

Please sign in to comment.