# HG changeset patch # User thomask # Date 1160665284 0 # Node ID 69d80e62f44cb9e32ab90865fe33cc7d3db62cc4 # Parent 6e7b74e51c2352f5d9d43b1847c4e39832df5aa2 [Issue 411] New: array alloc with size from another array Frank Benoit 2006-10-09 news:bug-411-3@http.d.puremagic.com/issues/ diff -r 6e7b74e51c23 -r 69d80e62f44c run/a/array_initialization_28_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/array_initialization_28_A.d Thu Oct 12 15:01:24 2006 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frank Benoit +// @date@ 2006-10-09 +// @uri@ news:bug-411-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 411] New: array alloc with size from another array + +module dstress.run.a.array_initialization_28_A; + +int main(){ + int[] asso; + asso ~= 3; + + byte[] x = new byte[](asso[0]); + + if(x.length != 3){ + assert(0); + } + + return 0; +} + diff -r 6e7b74e51c23 -r 69d80e62f44c run/a/array_initialization_28_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/array_initialization_28_B.d Thu Oct 12 15:01:24 2006 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frank Benoit +// @date@ 2006-10-09 +// @uri@ news:bug-411-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 411] New: array alloc with size from another array + +module dstress.run.a.array_initialization_28_B; + +int main(){ + int[] asso; + asso ~= 3; + + byte[] x = new byte[(asso[0])]; + + if(x.length != 3){ + assert(0); + } + + return 0; +} + diff -r 6e7b74e51c23 -r 69d80e62f44c run/a/array_initialization_28_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/array_initialization_28_C.d Thu Oct 12 15:01:24 2006 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frank Benoit +// @date@ 2006-10-09 +// @uri@ news:bug-411-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 411] New: array alloc with size from another array + +module dstress.run.a.array_initialization_28_C; + +int main(){ + int[] asso; + asso ~= 3; + + byte[] x = new byte[asso[0]]; + + if(x.length != 3){ + assert(0); + } + + return 0; +} +