Browse Source

Fix the naming of anonymous types when 2+ types are nested 2+ levels

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1204/head
Dimitar Dobrev 6 years ago
parent
commit
eb6a90d710
  1. 5
      src/Generator/Passes/CleanInvalidDeclNamesPass.cs
  2. 6
      tests/CSharp/CSharp.h

5
src/Generator/Passes/CleanInvalidDeclNamesPass.cs

@ -58,13 +58,12 @@ namespace CppSharp.Passes @@ -58,13 +58,12 @@ namespace CppSharp.Passes
return false;
DeclarationContext currentContext = context;
int parents = 0;
int order = -1;
while (currentContext != null)
{
parents++;
order++;
currentContext = currentContext.Namespace;
}
int order = parents % 2;
CheckChildrenNames(context.Declarations, ref order);
var @class = context as Class;

6
tests/CSharp/CSharp.h

@ -1311,6 +1311,12 @@ struct { @@ -1311,6 +1311,12 @@ struct {
struct {
struct {
int(*forIntegers)(int b, short s, unsigned int i);
struct {
int i;
} APIHost;
struct {
int i;
} Method;
} example;
} root;
} kotlin;

Loading…
Cancel
Save