From 1c6f38aa74466a7abdff144bf55937d2c90601d4 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Mon, 8 Jun 2020 18:32:22 -0300 Subject: [PATCH] dotnet: Ignore Efl.Object.parent as constructor In C# we already have Efl.Object.parent as an implicit constructor. Ignore it if it is marked as a constructor. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11951 --- src/bin/eolian_mono/eolian/mono/helpers.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh index f704ef00af..a13c26a1e8 100644 --- a/src/bin/eolian_mono/eolian/mono/helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/helpers.hh @@ -407,7 +407,15 @@ inline bool is_unique_event(attributes::event_def const& evt inline std::vector reorder_constructors(std::vector constructors) { auto is_required = [](attributes::constructor_def const& ctr) { return !ctr.is_optional; }; + auto is_object_parent = [](attributes::constructor_def const& ctr) + { + return (ctr.klass.namespaces.size() == 1 + && ctr.klass.namespaces[0] == "Efl" + && ctr.klass.eolian_name == "Object" + && ctr.name == "Efl.Object.parent"); + }; std::stable_partition(constructors.begin(), constructors.end(), is_required); + constructors.erase (std::remove_if (constructors.begin(), constructors.end(), is_object_parent), constructors.end()); return constructors; }