[Issue 5574] New: Error: this for ~this needs to be type foo not type foo[1u][1u]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 14 07:01:55 PST 2011


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

           Summary: Error: this for ~this needs to be type foo not type
                    foo[1u][1u]
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: puneet at coverify.org


--- Comment #0 from Puneet Goel <puneet at coverify.org> 2011-02-14 06:59:24 PST ---
I am using version 2.051 of the dmd compiler.

I am getting this error when I am instantiating a struct array with a
single element inside another class and only if there is the
destructor for the struct is explicitly defined. Is it a known error?

Here is a minimized snippet that gives error:

$ rdmd --main -unittest test.d
Error: this for ~this needs to be type foo not type foo[1u][1u]
Error: this for ~this needs to be type foo not type foo[1u]


// test.d

struct foo {
 int foofoo;
 ~this() {                     // no error if explicit destructor not
                               // defined
 }
}

class bar {
 foo fred;
 foo[2][2] foofoo;
 foo[1] frop;                  // this gives error
 foo[1][1] fropfrop;           // this too
}

unittest {
 foo frop;
 foo[1][1] fropfrop;           // this works
 bar burp;
}

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