Skip to content

Commit 8544995

Browse files
committed
Improve syntax node filtering in IMessengerRegisterAllGenerator
1 parent 849a0f1 commit 8544995

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CommunityToolkit.Mvvm.SourceGenerators/Messaging/IMessengerRegisterAllGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
2727
IncrementalValuesProvider<INamedTypeSymbol> typeSymbols =
2828
context.SyntaxProvider
2929
.CreateSyntaxProvider(
30-
static (node, _) => node is ClassDeclarationSyntax,
30+
static (node, _) => node is ClassDeclarationSyntax { BaseList.Types.Count: > 0 },
3131
static (context, _) => (INamedTypeSymbol)context.SemanticModel.GetDeclaredSymbol(context.Node)!);
3232

3333
// Get the target IRecipient<TMessage> interfaces and filter out other types

0 commit comments

Comments
 (0)