diff options
author | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2019-06-24 18:43:07 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2019-06-24 18:43:07 +0900 |
commit | 86afeee2246ebb9d58dc5676d58df137f5ba764c (patch) | |
tree | 2bb8132e569f8c8b215b56181efc53d65dafc892 | |
parent | 799b39afc5b36ce78a4be0c62a04639d5075fc33 (diff) | |
download | efl-86afeee2246ebb9d58dc5676d58df137f5ba764c.tar.gz |
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.hh | 7 |
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 return false; std::string klass_cast_name; - if (klass->type != attributes::class_type::interface_) - klass_cast_name = name_helpers::klass_inherit_name(*klass); - else + if ((klass->type == attributes::class_type::interface_) || + ((klass->type == attributes::class_type::mixin) && !f.is_static)) klass_cast_name = name_helpers::klass_interface_name(*klass); + else + klass_cast_name = name_helpers::klass_inherit_name(*klass); std::string self = "Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))"; |