From 9d70125da234521fa0f524cf8afdc08aa5f7ad34 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 9 Aug 2022 16:39:43 +0200 Subject: [PATCH] Fix capture delegate names lookup --- .../__Internals/ShaderMethodSourceAttribute.cs | 2 +- .../Extensions/ISymbolExtensions.cs | 4 ++-- .../Core/Extensions/MethodInfoExtensions.cs | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs b/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs index d3f7966b..d72109fe 100644 --- a/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs +++ b/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.cs @@ -78,7 +78,7 @@ public sealed partial class ShaderMethodSourceAttribute : Attribute } var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); - string methodName = function.Method.GetFullName(); + string methodName = function.Method.GetFullyQualifiedName(); foreach (var attribute in attributes) { diff --git a/src/ComputeSharp.SourceGeneration/Extensions/ISymbolExtensions.cs b/src/ComputeSharp.SourceGeneration/Extensions/ISymbolExtensions.cs index 170b648d..eb8d1951 100644 --- a/src/ComputeSharp.SourceGeneration/Extensions/ISymbolExtensions.cs +++ b/src/ComputeSharp.SourceGeneration/Extensions/ISymbolExtensions.cs @@ -76,7 +76,7 @@ internal static class ISymbolExtensions { if (includeParameters) { - var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); + string parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); return $"{symbol.ContainingType.GetFullMetadataName()}.{symbol.Name}({parameters})"; } @@ -95,7 +95,7 @@ internal static class ISymbolExtensions if (symbol.IsIndexer) { - var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); + string parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); return $"{declaringTypeName}.this[{parameters}]"; } diff --git a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs index b1eba145..b2f1a9ac 100644 --- a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs +++ b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs @@ -13,17 +13,17 @@ internal static class MethodInfoExtensions /// /// The input instance. /// A fully qualified name for , including parameters. - public static string GetFullName(this MethodInfo method) + public static string GetFullyQualifiedName(this MethodInfo method) { - var parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName)); + string parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName)); if (method.IsGenericMethod) { - var arguments = string.Join(", ", method.GetGenericArguments().Select(static t => t.FullName)); + string arguments = string.Join(", ", method.GetGenericArguments().Select(static t => t.FullName)); - return $"{method.DeclaringType!.FullName!.Replace('+', '.')}.{method.Name}<{arguments}>({parameters})"; + return $"{method.DeclaringType!.FullName!}.{method.Name}<{arguments}>({parameters})"; } - return $"{method.DeclaringType!.FullName!.Replace('+', '.')}.{method.Name}({parameters})"; + return $"{method.DeclaringType!.FullName!}.{method.Name}({parameters})"; } }