Browse Source

Fixed a C# generation crash with set-only properties.

We cannot use the getter return type because it might not exist (setter-only property). Use the setter's first (and only) parameter return type instead.
pull/146/merge
triton 12 years ago
parent
commit
72aa09009d
  1. 4
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

4
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -1124,8 +1124,8 @@ namespace CppSharp.Generators.CSharp
GeneratePropertyGetter(prop.GetMethod, @class); GeneratePropertyGetter(prop.GetMethod, @class);
if (prop.HasSetter) if (prop.HasSetter)
GeneratePropertySetter(prop.GetMethod.ReturnType, prop.SetMethod, GeneratePropertySetter(prop.SetMethod.Parameters[0].QualifiedType,
@class); prop.SetMethod, @class);
} }
WriteCloseBraceIndent(); WriteCloseBraceIndent();

Loading…
Cancel
Save