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 all commits
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
2 changes: 1 addition & 1 deletion src/Generator/Passes/GetterSetterToPropertyPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private static Stream GetResourceStream(Assembly assembly)
}

public GetterSetterToPropertyPass()
=> VisitOptions.ResetFlags(VisitFlags.ClassTemplateSpecializations);
=> VisitOptions.ResetFlags(VisitFlags.ClassBases | VisitFlags.ClassTemplateSpecializations);

public override bool VisitClassDecl(Class @class)
{
Expand Down
5 changes: 5 additions & 0 deletions tests/dotnet/CSharp/CSharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,11 @@ int HasConflictWithAbstractProperty::conflictWithProperty()
return 0;
}

int TestOverrideOfPropertyInNamespacedClass::property()
{
return 0;
}

const char* HasVirtualTakesReturnsProblematicTypes::virtualTakesAndReturnsString(const char* c)
{
return c;
Expand Down
13 changes: 13 additions & 0 deletions tests/dotnet/CSharp/CSharp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,19 @@ class DLL_API HasConflictWithAbstractProperty
virtual int getConflictWithProperty() = 0;
};

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

class DLL_API TestOverrideOfPropertyInNamespacedClass : public NamespaceWithVirtualPropertyClass::HasOverriddenPropertyInNamespacedClass {
public:
virtual int property() override;
};

template <typename T>
class lowerCase
{
Expand Down
Loading