From eb3529a805806fa332fe4b1bb89313899d418a7d Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Fri, 14 Jun 2019 16:46:48 +1000 Subject: [PATCH] fix: method parameters aren't escaped if they are keywords (#13) --- src/Pharmacist.Core/Generation/RoslynGeneratorExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pharmacist.Core/Generation/RoslynGeneratorExtensions.cs b/src/Pharmacist.Core/Generation/RoslynGeneratorExtensions.cs index c5a0b80..df4be46 100644 --- a/src/Pharmacist.Core/Generation/RoslynGeneratorExtensions.cs +++ b/src/Pharmacist.Core/Generation/RoslynGeneratorExtensions.cs @@ -112,7 +112,7 @@ public static ParameterListSyntax GenerateMethodParameters(this IMethod method) return SyntaxFactory.ParameterList( SyntaxFactory.SeparatedList( method.Parameters.Select( - x => SyntaxFactory.Parameter(SyntaxFactory.Identifier(x.Name)) + x => SyntaxFactory.Parameter(SyntaxFactory.Identifier(x.Name.GetKeywordSafeName())) .WithType(SyntaxFactory.IdentifierName(x.Type.GenerateFullGenericName()))))); }