[Issue 7743] New: Parsing problem with nothrow delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 20 19:53:09 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7743

           Summary: Parsing problem with nothrow delegate
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-03-20 19:53:27 PDT ---
This code compiles with no errors:

auto foo() {
    int x;
    return delegate() nothrow {
        return x;
    };
}
void main() {}



But with this version:

auto foo() {
    int x;
    return () nothrow {
        return x;
    };
}
void main() {}


DMD 2.059head gives:

test.d(3): expression expected, not ')'
test.d(3): found 'nothrow' when expecting ')'
test.d(3): found '{' when expecting ';' following return statement
test.d(6): unrecognized declaration


Maybe similar issues happens with other annotations.

-- 
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