[Issue 4285] New: template inside function error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 6 06:53:09 PDT 2010


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

           Summary: template inside function error message
           Product: D
           Version: future
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          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 2010-06-06 06:53:06 PDT ---
This is wrong D2 program:

void main() {
    template Foo {}
}


DMD v2.046 prints at compile-time:

test.d(2): found 'template' instead of statement
test.d(3): unrecognized declaration


But a better and more readable error message can be:

test.d(2): Error: template definitions aren't allowed inside functions.

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