Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Compare symbol names without null flow state #79094

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
C#: Compare symbol names without null flow state
  • Loading branch information
raulsntos committed Jul 6, 2023
commit 671a5b4ea57359d6a2281992a5012f7b6b170e64
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