www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5792] New: Tuple!(real,string) fails

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5792

           Summary: Tuple!(real,string) fails
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: magnus hetland.org



PDT ---
The following program fails to compile for me (DMD 2.052, OS X):

import std.typecons, std.container;
void main() {
    alias Tuple!(real,string) Entry;
    Array!Entry Q;
}

The error is:

phobos/std/container.d(1549): Error: this for _data needs to be type Array not
type Payload
phobos/std/container.d(1550): Error: this for _data needs to be type Array not
type Payload
phobos/std/container.d(1551): Error: this for _data needs to be type Array not
type Payload

If "string" is replaced by, say, "int", it works.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 28 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5792


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm gmail.com



The problem here is Array cannot have slice members. Reduced test case:


import std.container;
void main() {
    alias Array!(int[]) A;
}

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




The 3 lines in reserve() that emit the errors


                GC.removeRange(_data._payload.ptr);
                free(_data._payload.ptr);
                _data._payload = newPayload;


should probably read


                GC.removeRange(_payload.ptr);
                free(_payload.ptr);
                _payload = newPayload;

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






https://github.com/D-Programming-Language/phobos/pull/35

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


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrei metalanguage.com
         Resolution|                            |FIXED



07:24:06 PDT ---
Pulled https://github.com/D-Programming-Language/phobos/pull/35. Thanks!

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