Summary: Better array of inner structs error message
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-06-04 18:20:50 PDT ---
This wrong D2 program:

void main() {
    struct Foo {
        void bar() {}
    auto foos = new Foo[1]; // line 5

At compile time dmd v2.046 prints:
temp.d(5): Error: cannot have array of inner structs Foo

But for D newbies coming from C or C++ can find that error message cryptic.
Using a static struct solves this problem. So a possible error message can be:

temp.d(5): Error: cannot have array of inner structs Foo, you can use a 'static
struct' instead.

This improved error message is not perfect, but it seems better.

(I don't understand why D error messages don't have the ending full stop.)

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

Reply via email to