Page MenuHomePhabricator

C#: Fix virtual overrides in descendant classes
Closed, ResolvedPublic


After the new API was merged, virtual overrides in descendant classes (e.g. overriding Finalize - which comes from Efl.Object - in Efl.Ui.Button) stopped working. The test suite covered only the case where the overrides were from the same "level".

Some details of the virtual method implementation before going into the exact cause of the bug: In order to allow C to call the C# implementation of a given Eo method, whenever a pure C# class (opposed to generated C#-class) is instantiated for the first time, the bindings create a new Eo class with the first generated class as base. For example, class MyButton : Efl.Ui.Button will create a new wrapper - let's call Button#Inherit - that inherits from Efl.Ui.Button. This new class has a table of Efl_Op_Description that tells Eo to call some exported methods in the ButtonNativeInherit class. These methods take care of calling the C# implementation of the desired methods.

Back to the bug, currently we are generating these forwarding wrappers only for the methods implemented by the current class. Thus this Button#Inherit class have no idea that it has to forward Finalize and other methods above Efl.Ui.Button too.

I'm currently working on a patch to extend the list of operation to be forwarded calling with the parent list (branch devs/lauromoura/inherit_fix). It is mostly working but there are some issues instantiating the inherited classes.

lauromoura triaged this task as High priority.
lauromoura moved this task from Backlog to InProgress on the efl: language bindings board.
lauromoura lowered the priority of this task from High to TODO.
segfaultxavi raised the priority of this task from TODO to High.