GNOME Bugzilla – Bug 528457
base access broken with virtual interface method
Last modified: 2008-04-16 20:42:38 UTC
following code fails to produce valid C-code using GLib; public interface ITest { public abstract void foo (); } public class Muuh : Main { public override void foo () { base.foo (); } } public class Main : ITest { public virtual void foo () { stdout.printf ("Main.foo ()\n"); } public static int main () { var m = new Muuh (); m.foo (); return 0; } } GCC output: In file included from test.c:2: test.h:26: error: field ‘parent_instance’ has incomplete type test.c: In function ‘muuh_real_foo’: test.c:41: error: ‘muuh_itest_parent_iface’ undeclared (first use in this function) test.c:41: error: (Each undeclared identifier is reported only once test.c:41: error: for each function it appears in.) test.c:41: warning: cast to pointer from integer of different size test.c: In function ‘main_foo’: test.c:64: error: invalid type argument of ‘->’ error: cc exited with status 256
Confirming.
2008-04-16 Jürg Billeter <j@bitron.ch> * gobject/valaccodegenerator.vala, gobject/valaccodegeneratorinvocationexpression.vala, gobject/valaccodegeneratormemberaccess.vala: Fix base access with virtual interface methods, fixes bug 528457 * tests/classes-methods.vala: test base access Fixed in r1247.