Browse Source

Use a safe identifier when generating parameter names.

pull/1/head
triton 13 years ago
parent
commit
c3bf485502
  1. 2
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

2
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -308,7 +308,7 @@ namespace Cxxi.Generators.CSharp @@ -308,7 +308,7 @@ namespace Cxxi.Generators.CSharp
public string VisitParameter(Parameter arg, bool hasName)
{
var type = arg.Type.Visit(this, arg.QualifiedType.Qualifiers);
var name = arg.Name;
var name = Helpers.SafeIdentifier(arg.Name);
if (hasName && !string.IsNullOrEmpty(name))
return string.Format("{0} {1}", type, name);

Loading…
Cancel
Save