From 03c5585c74d3bab5c4263fe3a243ff911a1f9c68 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 27 Apr 2022 12:47:11 +0200 Subject: [PATCH] Fix remapping of keyword-named fields in this. expressions --- .../SyntaxRewriters/ShaderSourceRewriter.cs | 2 +- .../SyntaxRewriters/ShaderSourceRewriter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs index b519066b..2e32afce 100644 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -244,7 +244,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter // If the member access is a this. access, rewrite it to strip "this." if (node.Expression.IsKind(SyntaxKind.ThisExpression)) { - return node.Name; + return updatedNode.Name; } } diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs index 59e5e7fd..ff8329ff 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -276,7 +276,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter // If the member access is a this. access, rewrite it to strip "this." if (node.Expression.IsKind(SyntaxKind.ThisExpression)) { - return node.Name; + return updatedNode.Name; } }