diff --git a/src/Generator/Passes/GetterSetterToPropertyAdvancedPass.cs b/src/Generator/Passes/GetterSetterToPropertyAdvancedPass.cs index 7aed15f9..5da811ef 100644 --- a/src/Generator/Passes/GetterSetterToPropertyAdvancedPass.cs +++ b/src/Generator/Passes/GetterSetterToPropertyAdvancedPass.cs @@ -222,7 +222,7 @@ namespace CppSharp.Passes { if (method.Parameters.Count == 1) setters.Add(method); - else + else if (method.Parameters.Count > 1) setMethods.Add(method); } else diff --git a/tests/CSharpTemp/CSharpTemp.Tests.cs b/tests/CSharpTemp/CSharpTemp.Tests.cs index 8eeece86..a0b395e3 100644 --- a/tests/CSharpTemp/CSharpTemp.Tests.cs +++ b/tests/CSharpTemp/CSharpTemp.Tests.cs @@ -21,7 +21,11 @@ public class CSharpTempTests : GeneratorTestFixture new InheritsProtectedVirtualFromSecondaryBase().Dispose(); new InheritanceBuffer().Dispose(); new HasProtectedVirtual().Dispose(); - CSharpTemp.CSharpTemp.FreeFunctionWithUnsupportedDefaultArg(); + using (var foo = new Foo()) + { + var isNoParams = foo.IsNoParams; + foo.SetNoParams(); + } } [Test] diff --git a/tests/CSharpTemp/CSharpTemp.cpp b/tests/CSharpTemp/CSharpTemp.cpp index 876a6572..853ab162 100644 --- a/tests/CSharpTemp/CSharpTemp.cpp +++ b/tests/CSharpTemp/CSharpTemp.cpp @@ -26,6 +26,15 @@ int& Foo::operator[](int i) return P; } +bool Foo::isNoParams() +{ + return false; +} + +void Foo::setNoParams() +{ +} + const Foo& Bar::operator[](int i) const { return m_foo; diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index d657c6fd..ba341a76 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -11,7 +11,8 @@ public: int& operator[](int i); int A; int* (*functionPtrReturnsPtrParam)(); - int (STDCALL *attributedFunctionPtr)(); + bool isNoParams(); + void setNoParams(); static const int rename = 5;