[Issue 8934] New: Lambda violates DMD assertion
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 2 04:38:55 PDT 2012
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: nobody at puremagic.com
ReportedBy: dimitri.sabadie at gmail.com
--- Comment #0 from Dimitri Sabadie <dimitri.sabadie at 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: -------
More information about the Digitalmars-d-bugs
mailing list