http://d.puremagic.com/issues/show_bug.cgi?id=8934
Summary: Lambda violates DMD assertion Product: D Version: D2 Platform: x86_64 OS/Version: All Status: NEW Severity: major Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: dimitri.saba...@gmail.com --- Comment #0 from Dimitri Sabadie <dimitri.saba...@gmail.com> 2012-11-02 04:38:54 PDT --- I have found something interresting with lambdas. Consider this: string modules[] = [ "foo", "bar", "zoo" ]; string line; /* ... */ /* now line contains something not empty */ if (any!(a => a == line)(modules)) { /* ... */ } I get a DMD assertion crash on the if statement: Assertion failure: '!vthis->csym' on line 727 in file 'glue.c' Of course, the lambda syntax is, here, (string a) => a == line But sometimes a => a == line also works as inference type lambda! I don’t know why it doesn’t here. Also, this works too: (string a) { return a == line; } Is it the old delegate literal syntax? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------