Skip to content

Commit a96b2e2

Browse files
committed
Set an index when marshalling the value in setters of properties.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 84f145b commit a96b2e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Generator/Generators/CSharp/CSharpSources.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,8 @@ private void GenerateIndexerSetter(Function function)
979979
Name = "value",
980980
QualifiedType = new QualifiedType(type)
981981
},
982+
ParameterIndex = function.Parameters.Count(
983+
p => p.Kind != ParameterKind.IndirectReturnType),
982984
ReturnType = new QualifiedType(type)
983985
};
984986
var marshal = new CSharpMarshalManagedToNativePrinter(ctx);
@@ -2952,8 +2954,7 @@ public List<ParamMarshal> GenerateFunctionParamsMarshal(IEnumerable<Parameter> @
29522954
if (param.Kind == ParameterKind.IndirectReturnType)
29532955
continue;
29542956

2955-
marshals.Add(GenerateFunctionParamMarshal(param, paramIndex, function));
2956-
paramIndex++;
2957+
marshals.Add(GenerateFunctionParamMarshal(param, paramIndex++, function));
29572958
}
29582959

29592960
return marshals;

0 commit comments

Comments
 (0)