December 03, 2005 array.length and default init | ||||
---|---|---|---|---|
| ||||
Attachments: | The code below fails at runtime. # typedef X byte = 4; # # int main(){ # X[] array; # array.length = 1; # # assert(array[0] == 4); # # return 0; # } Added to DStress as http://dstress.kuehne.cn/run/a/array_initialization_20_A.d http://dstress.kuehne.cn/run/a/array_initialization_20_B.d http://dstress.kuehne.cn/run/a/array_initialization_20_C.d http://dstress.kuehne.cn/run/a/array_initialization_20_D.d http://dstress.kuehne.cn/run/a/array_initialization_20_E.d http://dstress.kuehne.cn/run/a/array_initialization_20_F.d http://dstress.kuehne.cn/run/a/array_initialization_20_G.d http://dstress.kuehne.cn/run/a/array_initialization_20_H.d Thomas |
Copyright © 1999-2021 by the D Language Foundation