Browse Source

Fixed getter/setter properties to inherit the access from their methods.

This is not ideal though, this won't deal properly with a getter and setter with different access specifiers.
pull/61/merge
triton 12 years ago
parent
commit
287dd7bf7c
  1. 2
      src/Generator/Passes/GetterSetterToPropertyPass.cs

2
src/Generator/Passes/GetterSetterToPropertyPass.cs

@ -88,6 +88,7 @@ namespace CppSharp.Passes @@ -88,6 +88,7 @@ namespace CppSharp.Passes
var name = method.Name.Substring("get".Length);
var prop = GetOrCreateProperty(@class, name, method.ReturnType);
prop.GetMethod = method;
prop.Access = method.Access;
// Do not generate the original method now that we know it is a getter.
method.IsGenerated = false;
@ -105,6 +106,7 @@ namespace CppSharp.Passes @@ -105,6 +106,7 @@ namespace CppSharp.Passes
var type = method.Parameters[0].QualifiedType;
var prop = GetOrCreateProperty(@class, name, type);
prop.SetMethod = method;
prop.Access = method.Access;
// Ignore the original method now that we know it is a setter.
method.IsGenerated = false;

Loading…
Cancel
Save