# HG changeset patch # User thomask # Date 1172489418 0 # Node ID f900501c0e18a6953e08b6a52517eb46549fcfbd # Parent 4a49d5a2169a8f72fab98de22bf2ce0ed81bb53e [Issue 999] Problem with auto and nested array literals Bill Baxter 2007-02-22 http://d.puremagic.com/issues/show_bug.cgi?id=999 diff -r 4a49d5a2169a -r f900501c0e18 run/a/auto_19_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/auto_19_A.d Mon Feb 26 11:30:18 2007 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter +// @date@ 2007-02-22 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=999 +// @desc@ [Issue 999] Problem with auto and nested array literals + +module dstress.run.a.auto_19_A; + +auto gfoo = [[3.0],[4.0]]; + +int main(){ + if(2 != gfoo.length){ + assert(0); + } + if(1 != gfoo[0].length){ + assert(0); + } + if(3.0 != gfoo[0][0]){ + assert(0); + } + if(1 != gfoo[1].length){ + assert(0); + } + if(4.0 != gfoo[1][0]){ + assert(0); + } + return 0; +} diff -r 4a49d5a2169a -r f900501c0e18 run/a/auto_19_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/auto_19_B.d Mon Feb 26 11:30:18 2007 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter +// @date@ 2007-02-22 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=999 +// @desc@ [Issue 999] Problem with auto and nested array literals + +module dstress.run.a.auto_19_B; + +int main(){ + auto foo = [[3.0],[4.0]]; + + if(2 != foo.length){ + assert(0); + } + if(1 != foo[0].length){ + assert(0); + } + if(3.0 != foo[0][0]){ + assert(0); + } + if(1 != foo[1].length){ + assert(0); + } + if(4.0 != foo[1][0]){ + assert(0); + } + return 0; +}