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 678617 - Does not pass const variables to lambda
Does not pass const variables to lambda
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
0.40.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
rejects-valid test-case
: 649564 669786 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-22 09:32 UTC by Guillaume Desmottes
Modified: 2018-05-22 14:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Guillaume Desmottes 2012-06-22 09:32:50 UTC
The following code build in valac but not in gcc:

    const uint AUTO_SCROLL_PITCH = 10;
   
    Timeout.add (10, () =>
      {
          print ("timeout %d\n", AUTO_SCROLL_PITCH);
          return false;
      });


egg-list-box.c:3229:46: error: 'AUTO_SCROLL_PITCH' undeclared (first use in this function)


Removing the 'const' fixes the issue.
Comment 1 Jürg Billeter 2012-06-24 15:06:13 UTC
commit d72b93c136b6fcc1dfa2cba10e45e676edfe0cc9
Author: Jürg Billeter <j@bitron.ch>
Date:   Sun Jun 24 17:02:01 2012 +0200

    Report error when accessing constants of outer methods
    
    This is planned to be supported.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678617
Comment 2 Rico Tzschichholz 2016-10-14 12:20:00 UTC
*** Bug 669786 has been marked as a duplicate of this bug. ***
Comment 3 Rico Tzschichholz 2018-02-21 12:43:37 UTC
*** Bug 649564 has been marked as a duplicate of this bug. ***
Comment 4 GNOME Infrastructure Team 2018-05-22 14:27:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/308.