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 543873 - Position dependent delegate declaration
Position dependent delegate declaration
Status: RESOLVED DUPLICATE of bug 471244
Product: vala
Classification: Core
Component: Delegates
0.3.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-20 16:02 UTC by Frederik Zipp
Modified: 2009-01-17 22:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Frederik Zipp 2008-07-20 16:02:25 UTC
// doesn't work

public delegate void FooFunc (Bar bar);

public class Bar {

	public void method (FooFunc f) {
	}

	static void main () {
	}
}

// works

public class Bar {

	public void method (FooFunc f) {
	}

	static void main () {
	}
}

public delegate void FooFunc (Bar bar);

--------------------------------------------------------------------
The first one produces a gcc error:

In file included from delegatetest.c:2:
delegatetest.h:10: Fehler: expected »)« before »*« token
delegatetest.h:35: Fehler: expected declaration specifiers or »...« before »FooFunc«
delegatetest.c:15: Fehler: expected declaration specifiers or »...« before »FooFunc«
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
--------------------------------------------------------------------

The delgate declaration should be position independent.
Comment 1 Jürg Billeter 2008-11-20 21:28:09 UTC
Confirming.
Comment 2 Jürg Billeter 2009-01-17 22:19:26 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 471244 ***