From 155a334005294dbac979851a97783476a8b15517 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Aug 2021 08:03:33 -0600 Subject: [PATCH] Don't consider classes that do not have any attributes or base classes (#58004) --- 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 51b548e..84212e8 100644 --- a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs +++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.cs @@ -63,7 +63,7 @@ namespace System.Text.Json.SourceGeneration 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); } -- 2.7.4