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;