Summary: Better error message with map!{...}()
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-09-25 11:06:22 PDT ---
A low-priority enhancement request.
This is wrong D2 code:

import std.algorithm;
void main() {
    auto r = map!{ a * a }([1, 2]);

DMD 2.056head gives four error messages:

test.d(3): template argument expected following !
test.d(3): semicolon expected following auto declaration, not '{'
test.d(3): found '}' when expecting ';' following statement
test.d(4): found 'EOF' when expecting '}' following compound statement

It contains a common mistake:

instead of:

Given how common such mistake is in my code, I'd like the compiler to recognize
it and show (if possible) a single and more readable error message.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to