From 7b348708e8244aef4b523e5336cb99890be4b77f Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Sat, 5 Aug 2023 19:45:22 +0200 Subject: [PATCH] C#: Use SymbolEqualityComparer Use `SymbolEqualityComparer` to compare symbols and fix `RS1024` warning. --- .../Godot.SourceGenerators/ScriptPathAttributeGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs index d6d8a93e03c..625a6f99211 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPathAttributeGenerator.cs @@ -55,8 +55,8 @@ namespace Godot.SourceGenerators .Where(x => // Ignore classes whose name is not the same as the file name Path.GetFileNameWithoutExtension(x.cds.SyntaxTree.FilePath) == x.symbol.Name) - .GroupBy(x => x.symbol) - .ToDictionary(g => g.Key, g => g.Select(x => x.cds)); + .GroupBy<(ClassDeclarationSyntax cds, INamedTypeSymbol symbol), INamedTypeSymbol>(x => x.symbol, SymbolEqualityComparer.Default) + .ToDictionary, INamedTypeSymbol, IEnumerable>(g => g.Key, g => g.Select(x => x.cds), SymbolEqualityComparer.Default); foreach (var godotClass in godotClasses) {