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 7 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
return false; return false;
DeclarationContext currentContext = context; DeclarationContext currentContext = context;
int parents = 0; int order = -1;
while (currentContext != null) while (currentContext != null)
{ {
parents++; order++;
currentContext = currentContext.Namespace; currentContext = currentContext.Namespace;
} }
int order = parents % 2;
CheckChildrenNames(context.Declarations, ref order); CheckChildrenNames(context.Declarations, ref order);
var @class = context as Class; var @class = context as Class;

6
tests/CSharp/CSharp.h

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

Loading…
Cancel
Save