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 501584 - Invalid C code for constant delegates
Invalid C code for constant delegates
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.1.x
Other All
: Low normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
: 522059 (view as bug list)
Depends on:
Blocks: 522060
 
 
Reported: 2007-12-04 19:12 UTC by Jürg Billeter
Modified: 2008-03-16 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jürg Billeter 2007-12-04 19:12:36 UTC
Reported by Dominique Würtz:

this

using GLib;

public class BugDemo
{
        void foo() {
        }

        const GLib.Callback bar = foo;
}

leads to genarition of wrong C code. Problem is that in the .c file
function declarations appear after initialization of const member
variables.
Comment 1 Jürg Billeter 2008-03-16 21:21:16 UTC
*** Bug 522059 has been marked as a duplicate of this bug. ***
Comment 2 Jürg Billeter 2008-03-16 21:28:27 UTC
2008-03-16  Jürg Billeter  <j@bitron.ch>

	* gobject/valaccodegenerator.vala,
	  gobject/valaccodegeneratorsourcefile.vala: emit constants after
	  function declarations as constants may depend on function
	  declarations, fixes bug 501584

	* tests/delegates.vala: test constants depending on function
	  declarations

Fixed in r1130.