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 637714 - Foreach element variable not captured using lambda function
Foreach element variable not captured using lambda function
Status: RESOLVED DUPLICATE of bug 628336
Product: vala
Classification: Core
Component: Code Generator
0.10.x
Other Linux
: Urgent blocker
: ---
Assigned To: Vala maintainers
Vala maintainers
wrong-code test-case
Depends on:
Blocks:
 
 
Reported: 2010-12-21 02:27 UTC by BianShaoLei
Modified: 2011-01-04 09:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description BianShaoLei 2010-12-21 02:27:35 UTC
Simple Code:

    public static void main(){
        string f = "abc def";
        try{
            foreach(var s in f.split(" ")){
                message("%s", s); 
                unowned Thread t = Thread.create(()=>{
                        message("%s", s); 
                        return null;
                        }, true);
                t.join();
            }   
        }catch(Error e){ 
        }   
    }
=======================================================
In both message, it showed 'null'.

valac --version
Vala 0.10.1
Comment 1 Luca Bruno 2011-01-04 09:08:47 UTC

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