Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #1283 #1855

Merged
merged 4 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for issue #1283
  • Loading branch information
angryzor committed Jul 26, 2024
commit 7ead06e1a64685493d553944902895410ba9f19f
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;
};
Loading