From 70a8489145a2ac56b0b18a2c86847911de391955 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 19 Aug 2021 10:52:35 -0700 Subject: [PATCH] Don't consider classes that do not have any attributes or base classes --- src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs index 399b893e8e8e90..b1f71a7372804a 100644 --- a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs +++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs @@ -67,7 +67,7 @@ private sealed class SyntaxReceiver : ISyntaxReceiver public void OnVisitSyntaxNode(SyntaxNode syntaxNode) { - if (syntaxNode is ClassDeclarationSyntax cds) + if (syntaxNode is ClassDeclarationSyntax { AttributeLists.Count: > 0, BaseList.Types.Count: > 0 } cds) { (ClassDeclarationSyntaxList ??= new List()).Add(cds); }