summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2019-06-24 18:43:07 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-06-24 18:43:07 +0900
commit86afeee2246ebb9d58dc5676d58df137f5ba764c (patch)
tree2bb8132e569f8c8b215b56181efc53d65dafc892
parent799b39afc5b36ce78a4be0c62a04639d5075fc33 (diff)
eolian_mono: fix to call mixin's method in inherited class
Summary: Eo mixin is converted to C# interface and C# concrete class. When the mixin's method is called, the delegate function of Eo mixin's C# concrete class is called. Now, the delegate function of Eo mixin's C# concrete class calls C# method with casting to Eo mixin's C# concrete class type. e.g. ((IClickableConcrete)ws.Target).Press(button); If a user defined C# class implements Eo mixin's C# interface, the implemented method cannot be called because the user defined C# class type is not the same as Eo mixin's C# concrete class. To resolve the above issue, the type casting code is fixed. Reviewers: felipealmeida, lauromoura, vitor.sousa, YOhoho Reviewed By: YOhoho Subscribers: bu5hm4n, YOhoho, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9111
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 8fc7225bf3..861092d40a 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -85,10 +85,11 @@ struct native_function_definition_generator
85 return false; 85 return false;
86 86
87 std::string klass_cast_name; 87 std::string klass_cast_name;
88 if (klass->type != attributes::class_type::interface_) 88 if ((klass->type == attributes::class_type::interface_) ||
89 klass_cast_name = name_helpers::klass_inherit_name(*klass); 89 ((klass->type == attributes::class_type::mixin) && !f.is_static))
90 else
91 klass_cast_name = name_helpers::klass_interface_name(*klass); 90 klass_cast_name = name_helpers::klass_interface_name(*klass);
91 else
92 klass_cast_name = name_helpers::klass_inherit_name(*klass);
92 93
93 std::string self = "Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))"; 94 std::string self = "Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))";
94 95