From: Lauro Moura Date: Mon, 11 Feb 2019 18:53:29 +0000 (-0200) Subject: efl-csharp: Fix self in iface concrete functions X-Git-Tag: submit/tizen/20190308.115227~245 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2114a5bc3de3c5ee9755c02e1e317b5c6539aa2d;p=platform%2Fupstream%2Fefl.git efl-csharp: Fix self in iface concrete functions Summary: It was mistakenly being called as static functions. Fixes T7619 Test Plan: See attached testcase. Reviewers: segfaultxavi, bu5hm4n, vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7619 Differential Revision: https://phab.enlightenment.org/D7904 --- diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh index 5a78bc7..f89ac95 100644 --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -169,7 +169,7 @@ struct function_definition_generator // inherited is set in the constructor, true if this instance is from a pure C# class (not generated). if (do_super && !f.is_static) self = "(inherited ? Efl.Eo.Globals.efl_super(" + self + ", this.NativeClass) : " + self + ")"; - else + else if (f.is_static) self = name_helpers::klass_get_full_name(f.klass) + "()"; if(!as_generator diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs index 37d4735..ed1d65a 100644 --- a/src/tests/efl_mono/Eo.cs +++ b/src/tests/efl_mono/Eo.cs @@ -369,4 +369,17 @@ class TestConstructors } } +class TestInterfaceConcrete +{ + // For T7619 + public static void test_iface_concrete_methods() + { + var obj = new Dummy.TestObject(); + Dummy.TestIface iface = Dummy.TestIfaceConcrete.static_cast(obj); + + iface.IfaceProp = 1970; + Test.AssertEquals(iface.IfaceProp, 1970); + } +} + }