GNOME Bugzilla – Bug 649564
invalid C code generated from using const in async callback block
Last modified: 2018-02-21 12:43:37 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.
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) ^^^^^^^^^
*** This bug has been marked as a duplicate of bug 678617 ***