GNOME Bugzilla – Bug 523263
Compiler error when implementing an abstract method in an abstract class
Last modified: 2008-04-07 16:28:43 UTC
Please describe the problem: abstract class Foo1 : GLib.Object { public abstract void my_func(); } abstract class Foo2 : Foo1 { public override void my_func() { return; } } class Foo3 : Foo2 { } Valac complains that Foo3 does not implement abstract method "Foo1.my_func", which actually Foo2 class implements. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Confirming.
2008-04-07 Jürg Billeter <j@bitron.ch> * vala/valasemanticanalyzer.vala: fix spurious error when overriding abstract method in derived abstract class, fixes bug 523263 * tests/classes-methods.vala: test overriding abstract method in derived abstract class Fixed in r1172.
The bug is not fully fixed I think, I can still reproduce the error _IF_ I declare the classes in "incorrect" order like this: public class Maman.Bottom : Middle { } public abstract class Maman.Top : GLib.Object { public abstract void method(); } public abstract class Maman.Middle : Top { public override void method() { return; } }
2008-04-07 Jürg Billeter <j@bitron.ch> * vala/valasemanticanalyzer.vala: don't compare base_method and base_interface_method in visit_class as this might not be set yet in other classes; available methods will already be checked in detail in visit_method, fixes bug 523263 Fixed in r1177.