diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index e45fb9f5..3e4383e5 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -922,7 +922,7 @@ namespace CppSharp.Generators.CSharp { var ctx = new CSharpMarshalContext(Driver) { - ReturnVarName = param.Name, + ReturnVarName = Helpers.SafeIdentifier(param.Name), ReturnType = param.QualifiedType };