diff --git a/src/Generator/Passes/RenamePass.cs b/src/Generator/Passes/RenamePass.cs index 316cd816..77c3eaf9 100644 --- a/src/Generator/Passes/RenamePass.cs +++ b/src/Generator/Passes/RenamePass.cs @@ -170,14 +170,12 @@ namespace CppSharp.Passes declarations.AddRange(decl.Namespace.Classes.Where(c => !c.IsIncomplete)); declarations.AddRange(decl.Namespace.Enums); declarations.AddRange(decl.Namespace.Events); + declarations.Add(decl.Namespace); var function = decl as Function; if (function != null) - { - declarations.Add(function.Namespace); // account for overloads declarations.AddRange(GetFunctionsWithTheSameParams(function)); - } else declarations.AddRange(decl.Namespace.Functions); diff --git a/tests/Common/Common.Tests.cs b/tests/Common/Common.Tests.cs index b41875a9..24d6cbc5 100644 --- a/tests/Common/Common.Tests.cs +++ b/tests/Common/Common.Tests.cs @@ -47,6 +47,10 @@ public class CommonTests : GeneratorTestFixture using (var hasProtectedEnum = new HasProtectedEnum()) { } + using (var hasPropertyNamedAsParent = new HasPropertyNamedAsParent()) + { + hasPropertyNamedAsParent.hasPropertyNamedAsParent.GetHashCode(); + } EnumWithUnderscores e = EnumWithUnderscores.lOWER_BEFORE_CAPITAL; e = EnumWithUnderscores.UnderscoreAtEnd; e = EnumWithUnderscores.CAPITALS_More; diff --git a/tests/Common/Common.cpp b/tests/Common/Common.cpp index de393597..e7684deb 100644 --- a/tests/Common/Common.cpp +++ b/tests/Common/Common.cpp @@ -999,6 +999,14 @@ AmbiguousParamNames::~AmbiguousParamNames() { } +HasPropertyNamedAsParent::HasPropertyNamedAsParent() +{ +} + +HasPropertyNamedAsParent::~HasPropertyNamedAsParent() +{ +} + void integerOverload(int i) { } diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 7a31bf6d..b36f37c6 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -1401,6 +1401,14 @@ public: ~AmbiguousParamNames(); }; +class DLL_API HasPropertyNamedAsParent +{ +public: + HasPropertyNamedAsParent(); + ~HasPropertyNamedAsParent(); + int hasPropertyNamedAsParent; +}; + template void TemplatedFunction(T type) {