Summary: Lambda violates DMD assertion
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Dimitri Sabadie <> 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:
------- You are receiving this mail because: -------

Reply via email to