Skip to content

Commit

Permalink
C#: Compare symbol names without null flow state
Browse files Browse the repository at this point in the history
  • Loading branch information
raulsntos committed Jul 6, 2023
1 parent 4642448 commit 671a5b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static bool InheritsFrom(this INamedTypeSymbol? symbol, string assemblyNa
while (symbol != null)
{
if (symbol.ContainingAssembly?.Name == assemblyName &&
symbol.ToString() == typeFullName)
symbol.FullQualifiedNameOmitGlobal() == typeFullName)
{
return true;
}
Expand Down Expand Up @@ -230,22 +230,22 @@ public static string SanitizeQualifiedNameForUniqueHint(this string qualifiedNam
.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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private static IEnumerable<PropertyInfo> DetermineGroupingPropertyInfo(ISymbol m
{
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ out INamedTypeSymbol? symbol
}

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,
Expand Down

0 comments on commit 671a5b4

Please sign in to comment.