From 0895429e65708583b79116d5459e46d19ed4b102 Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 29 May 2013 19:28:03 +0100 Subject: [PATCH] When generating the setter method of a property, use the first method parameter type as the type for the setter. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 1af20317..e45fb9f5 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -649,6 +649,12 @@ namespace CppSharp.Generators.CSharp if (decl is Function) { var function = decl as Function; + + if (function.Parameters.Count == 0) + throw new NotSupportedException("Expected at least one parameter in setter"); + + param.QualifiedType = function.Parameters[0].QualifiedType; + var parameters = new List { param }; GenerateInternalFunctionCall(function, parameters); }