Skip to content

Commit

Permalink
Add test for issue #1283
Browse files Browse the repository at this point in the history
  • Loading branch information
angryzor committed Jul 26, 2024
1 parent f5cf031 commit 7ead06e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Generator.Tests/Passes/TestPasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,17 @@ public void TestFlattenAnonymousTypesToFields()
Assert.AreEqual(AccessSpecifier.Protected, @protected.Access);
}

[Test]
public void TestGetterSetterToPropertyPassHandlesBaseClassesFirst()
{
var @class = AstContext.Class("TestOverridingVirtualPropertyInNamespacedClass");

passBuilder.AddPass(new GetterSetterToPropertyPass());
passBuilder.RunPasses(pass => pass.VisitASTContext(AstContext));

Assert.IsNotEmpty(@class.Properties);
}

private PassBuilder<TranslationUnitPass> passBuilder;
}
}
13 changes: 13 additions & 0 deletions tests/dotnet/Native/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,16 @@ class TestExtractInterfacePass
public:
void DoSomething();
};

// https://github.com/mono/CppSharp/issues/1283
namespace NamespaceWithVirtualPropertyClass {
class TestNamespacedClassWithVirtualProperty {
public:
virtual int property();
};
}

class TestOverridingVirtualPropertyInNamespacedClass : public NamespaceWithVirtualPropertyClass::TestNamespacedClassWithVirtualProperty {
public:
virtual int property() override;
};

0 comments on commit 7ead06e

Please sign in to comment.