After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 523263 - Compiler error when implementing an abstract method in an abstract class
Compiler error when implementing an abstract method in an abstract class
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
0.1.x
Other All
: High normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-18 22:51 UTC by Jacob Kroon
Modified: 2008-04-07 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jacob Kroon 2008-03-18 22:51:58 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:
Comment 1 Jürg Billeter 2008-03-21 10:08:53 UTC
Confirming.
Comment 2 Jürg Billeter 2008-04-07 14:21:58 UTC
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.
Comment 3 Jacob Kroon 2008-04-07 16:15:50 UTC
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;
  }
}
Comment 4 Jürg Billeter 2008-04-07 16:28:43 UTC
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.