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 528457 - base access broken with virtual interface method
base access broken with virtual interface method
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.2.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-16 18:50 UTC by Andreas Brauchli
Modified: 2008-04-16 20:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Brauchli 2008-04-16 18:50:56 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
Comment 1 Jürg Billeter 2008-04-16 20:42:19 UTC
Confirming.
Comment 2 Jürg Billeter 2008-04-16 20:42:38 UTC
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.