diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-07-07 08:35:20 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-07-07 08:35:20 +0200 |
| commit | 26a58976e7c650b29ae9c48777a65f03ebb3812b (patch) | |
| tree | 5a3869ff21972a439d1863ce8ff0a59bc1afd7b0 /modules/mono | |
| parent | 69dbbcc313c45496347a82a094cc421e5b990fb9 (diff) | |
| parent | 671a5b4ea57359d6a2281992a5012f7b6b170e64 (diff) | |
| download | redot-engine-26a58976e7c650b29ae9c48777a65f03ebb3812b.tar.gz | |
Merge pull request #79094 from raulsntos/dotnet/fix-symbol-comparison
C#: Compare symbol names without null flow state
Diffstat (limited to 'modules/mono')
3 files changed, 9 insertions, 9 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs index 38af1cbade..b2a3c046e5 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs @@ -37,7 +37,7 @@ namespace Godot.SourceGenerators while (symbol != null) { if (symbol.ContainingAssembly?.Name == assemblyName && - symbol.ToString() == typeFullName) + symbol.FullQualifiedNameOmitGlobal() == typeFullName) { return true; } @@ -230,22 +230,22 @@ namespace Godot.SourceGenerators .Replace(">", ")"); public static bool IsGodotExportAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GodotClasses.ExportAttr; + => symbol.FullQualifiedNameOmitGlobal() == GodotClasses.ExportAttr; public static bool IsGodotSignalAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GodotClasses.SignalAttr; + => symbol.FullQualifiedNameOmitGlobal() == GodotClasses.SignalAttr; public static bool IsGodotMustBeVariantAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GodotClasses.MustBeVariantAttr; + => symbol.FullQualifiedNameOmitGlobal() == GodotClasses.MustBeVariantAttr; public static bool IsGodotClassNameAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GodotClasses.GodotClassNameAttr; + => symbol.FullQualifiedNameOmitGlobal() == GodotClasses.GodotClassNameAttr; public static bool IsGodotGlobalClassAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GodotClasses.GlobalClassAttr; + => symbol.FullQualifiedNameOmitGlobal() == GodotClasses.GlobalClassAttr; public static bool IsSystemFlagsAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GodotClasses.SystemFlagsAttr; + => symbol.FullQualifiedNameOmitGlobal() == GodotClasses.SystemFlagsAttr; public static GodotMethodData? HasGodotCompatibleSignature( this IMethodSymbol method, diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs index e856ad5c13..3e6858485d 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs @@ -362,7 +362,7 @@ namespace Godot.SourceGenerators { foreach (var attr in memberSymbol.GetAttributes()) { - PropertyUsageFlags? propertyUsage = attr.AttributeClass?.ToString() switch + PropertyUsageFlags? propertyUsage = attr.AttributeClass?.FullQualifiedNameOmitGlobal() switch { GodotClasses.ExportCategoryAttr => PropertyUsageFlags.Category, GodotClasses.ExportGroupAttr => PropertyUsageFlags.Group, diff --git a/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/ExtensionMethods.cs b/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/ExtensionMethods.cs index 37f7005d01..a0bd96412a 100644 --- a/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/ExtensionMethods.cs +++ b/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/ExtensionMethods.cs @@ -38,7 +38,7 @@ internal static class ExtensionMethods } private static bool IsGenerateUnmanagedCallbacksAttribute(this INamedTypeSymbol symbol) - => symbol.ToString() == GeneratorClasses.GenerateUnmanagedCallbacksAttr; + => symbol.FullQualifiedNameOmitGlobal() == GeneratorClasses.GenerateUnmanagedCallbacksAttr; public static IEnumerable<(ClassDeclarationSyntax cds, INamedTypeSymbol symbol)> SelectUnmanagedCallbacksClasses( this IEnumerable<ClassDeclarationSyntax> source, |
