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 649564 - invalid C code generated from using const in async callback block
invalid C code generated from using const in async callback block
Status: RESOLVED DUPLICATE of bug 678617
Product: vala
Classification: Core
Component: Parser
0.12.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-06 12:53 UTC by Andy Tai
Modified: 2018-02-21 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vala file demonstrating the bug (426 bytes, text/plain)
2011-05-06 12:53 UTC, Andy Tai
Details

Description Andy Tai 2011-05-06 12:53:40 UTC
Created attachment 187354 [details]
vala file demonstrating the bug

compiling the attached t2.vala, 

[atai@HPQuad tmp]$ valac --pkg "gtk+-2.0" t2.vala
/tmp/t2.vala.c: In function ‘_lambda1_’:
/tmp/t2.vala.c:29:13: error: ‘WAIT_TIME’ undeclared (first use in this function)
/tmp/t2.vala.c:29:13: note: each undeclared identifier is reported only once for each function it appears in
/tmp/t2.vala.c: In function ‘_lambda0_’:
/tmp/t2.vala.c:47:41: error: ‘WAIT_TIME’ undeclared (first use in this function)
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


Invalid c code failed to be compiled by gcc.
Comment 1 Michael 'Mickey' Lauer 2018-02-21 11:59:28 UTC
With Vala master, an internal error is emitted now:

% valac --pkg=gtk+-3.0 bug649564.vala                                                                                                             bug649564.vala:10.49-10.57: error: internal error: accessing local constants of outer methods is not supported yet
	    TimeoutSource time_out = new TimeoutSource(WAIT_TIME);
	                                               ^^^^^^^^^
bug649564.vala:13.29-13.37: error: internal error: accessing local constants of outer methods is not supported yet
                if ( 100 >= WAIT_TIME)
                            ^^^^^^^^^
Comment 2 Rico Tzschichholz 2018-02-21 12:43:37 UTC

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