www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5574] New: Error: this for ~this needs to be type foo not type foo[1u][1u]

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: puneet coverify.org



---
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: -------
Feb 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5574


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k.hara.pg gmail.com



Simple test case:
----
struct foo5574a
{
    ~this() {}
}
class bar5574a
{
    foo5574a[1] frop;
}
----

Postblit has similar problem:
----
struct foo5574b
{
    this(this){}
}
struct bar5574b
{
    foo5574b[1] frop;
}
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 19 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5574


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



03:19:08 PDT ---
https://github.com/D-Programming-Language/dmd/commit/0b04816b04011293388686741f04c285e7efa6d4

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 20 2011