Bug 5792 – Tuple!(real,string) fails

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-03-28T14:33:00Z
Last change time
2011-05-03T07:24:06Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
magnus

Comments

Comment #0 by magnus — 2011-03-28T14:33:58Z
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.
Comment #1 by kennytm — 2011-03-28T14:57:27Z
The problem here is Array cannot have slice members. Reduced test case: import std.container; void main() { alias Array!(int[]) A; }
Comment #2 by kennytm — 2011-03-28T15:13:14Z
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;
Comment #3 by kennytm — 2011-05-03T05:50:11Z
Comment #4 by andrei — 2011-05-03T07:24:06Z