From eb53ae71f9111e2c24585cfc7078db220bf46f72 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Wed, 18 Nov 2020 01:03:45 +0000 Subject: [PATCH] Save existing parameter when doing C++ parameter type printing. --- src/Generator/Generators/C/CppTypePrinter.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/C/CppTypePrinter.cs b/src/Generator/Generators/C/CppTypePrinter.cs index 9e284fb8..6258ca4d 100644 --- a/src/Generator/Generators/C/CppTypePrinter.cs +++ b/src/Generator/Generators/C/CppTypePrinter.cs @@ -413,7 +413,12 @@ namespace CppSharp.Generators.C public override TypePrinterResult VisitParameter(Parameter param, bool hasName = true) { - var result = param.Type.Visit(this, param.QualifiedType.Qualifiers); + Parameter oldParam = Parameter; + Parameter = param; + + var result = param.QualifiedType.Visit(this); + + Parameter = oldParam; string name = param.Name; bool printName = hasName && !string.IsNullOrEmpty(name);