digitalmars.D - cannot resize a dynamic array of int[int]
- Ran (10/10) Oct 21 2008 It should be a stupid question. But I still hope for any response. Could...
- Denis Koroskin (3/14) Oct 21 2008 This is a bug, try wrapping the assoc. array in a struct so that you mak...
- Jarrett Billingsley (4/20) Oct 21 2008 It's a bug that's been around for way too fucking long, excuse the
- Steven Schveighoffer (3/36) Oct 21 2008 -Steve
- Jarrett Billingsley (3/47) Oct 21 2008 Downs posted an equivalent solution over a year ago to the same bug.
- Steven Schveighoffer (3/60) Oct 21 2008 I meant FWI. (For Walter's Info) ;)
It should be a stupid question. But I still hope for any response. Could anyone tell me pls why the following code doesn't work ? uint numberOfSubsets(uint n) { return (1 << n) - 1; } void main(char[][] args) { int[int] a[]; a.length = numberOfSubsets(3); } The generated program runs endlessly. I'm using D2. Ran
Oct 21 2008
On Tue, 21 Oct 2008 21:24:28 +0400, Ran <saotome.ran googlemail.com> wrote:It should be a stupid question. But I still hope for any response. Could anyone tell me pls why the following code doesn't work ? uint numberOfSubsets(uint n) { return (1 << n) - 1; } void main(char[][] args) { int[int] a[]; a.length = numberOfSubsets(3); } The generated program runs endlessly. I'm using D2. RanThis is a bug, try wrapping the assoc. array in a struct so that you make array of structs instead of array of maps. It should help.
Oct 21 2008
On Tue, Oct 21, 2008 at 1:31 PM, Denis Koroskin <2korden gmail.com> wrote:On Tue, 21 Oct 2008 21:24:28 +0400, Ran <saotome.ran googlemail.com> wrote:It's a bug that's been around for way too fucking long, excuse the language. It's apparently a one-character change in the typeinfo for AAs.It should be a stupid question. But I still hope for any response. Could anyone tell me pls why the following code doesn't work ? uint numberOfSubsets(uint n) { return (1 << n) - 1; } void main(char[][] args) { int[int] a[]; a.length = numberOfSubsets(3); } The generated program runs endlessly. I'm using D2. RanThis is a bug, try wrapping the assoc. array in a struct so that you make array of structs instead of array of maps. It should help.
Oct 21 2008
"Jarrett Billingsley" wroteOn Tue, Oct 21, 2008 at 1:31 PM, Denis Koroskin <2korden gmail.com> wrote:FYI, this was just posted to the bug report:On Tue, 21 Oct 2008 21:24:28 +0400, Ran <saotome.ran googlemail.com> wrote:It's a bug that's been around for way too fucking long, excuse the language. It's apparently a one-character change in the typeinfo for AAs.It should be a stupid question. But I still hope for any response. Could anyone tell me pls why the following code doesn't work ? uint numberOfSubsets(uint n) { return (1 << n) - 1; } void main(char[][] args) { int[int] a[]; a.length = numberOfSubsets(3); } The generated program runs endlessly. I'm using D2. RanThis is a bug, try wrapping the assoc. array in a struct so that you make array of structs instead of array of maps. It should help.http://d.puremagic.com/issues/show_bug.cgi?id=929 12:40 ------- Just to make the patch more explicit: Adding int TypeAArray::isZeroInit() { return 1; } to mtype.c and the matching prototype to mtype.h fixes it. Tested in LDC.-Steve
Oct 21 2008
On Tue, Oct 21, 2008 at 3:41 PM, Steven Schveighoffer <schveiguy yahoo.com> wrote:"Jarrett Billingsley" wroteDowns posted an equivalent solution over a year ago to the same bug.On Tue, Oct 21, 2008 at 1:31 PM, Denis Koroskin <2korden gmail.com> wrote:FYI, this was just posted to the bug report:On Tue, 21 Oct 2008 21:24:28 +0400, Ran <saotome.ran googlemail.com> wrote:It's a bug that's been around for way too fucking long, excuse the language. It's apparently a one-character change in the typeinfo for AAs.It should be a stupid question. But I still hope for any response. Could anyone tell me pls why the following code doesn't work ? uint numberOfSubsets(uint n) { return (1 << n) - 1; } void main(char[][] args) { int[int] a[]; a.length = numberOfSubsets(3); } The generated program runs endlessly. I'm using D2. RanThis is a bug, try wrapping the assoc. array in a struct so that you make array of structs instead of array of maps. It should help.http://d.puremagic.com/issues/show_bug.cgi?id=929 12:40 ------- Just to make the patch more explicit: Adding int TypeAArray::isZeroInit() { return 1; } to mtype.c and the matching prototype to mtype.h fixes it. Tested in LDC.-Steve
Oct 21 2008
"Jarrett Billingsley" wroteOn Tue, Oct 21, 2008 at 3:41 PM, Steven Schveighoffer <schveiguy yahoo.com> wrote:I meant FWI. (For Walter's Info) ;) -Steve"Jarrett Billingsley" wroteDowns posted an equivalent solution over a year ago to the same bug.On Tue, Oct 21, 2008 at 1:31 PM, Denis Koroskin <2korden gmail.com> wrote:FYI, this was just posted to the bug report:On Tue, 21 Oct 2008 21:24:28 +0400, Ran <saotome.ran googlemail.com> wrote:It's a bug that's been around for way too fucking long, excuse the language. It's apparently a one-character change in the typeinfo for AAs.It should be a stupid question. But I still hope for any response. Could anyone tell me pls why the following code doesn't work ? uint numberOfSubsets(uint n) { return (1 << n) - 1; } void main(char[][] args) { int[int] a[]; a.length = numberOfSubsets(3); } The generated program runs endlessly. I'm using D2. RanThis is a bug, try wrapping the assoc. array in a struct so that you make array of structs instead of array of maps. It should help.http://d.puremagic.com/issues/show_bug.cgi?id=929 12:40 ------- Just to make the patch more explicit: Adding int TypeAArray::isZeroInit() { return 1; } to mtype.c and the matching prototype to mtype.h fixes it. Tested in LDC.-Steve
Oct 21 2008