changeset 1363:f900501c0e18

[Issue 999] Problem with auto and nested array literals Bill Baxter <wbaxter@gmail.com> 2007-02-22 http://d.puremagic.com/issues/show_bug.cgi?id=999
author thomask
date Mon, 26 Feb 2007 11:30:18 +0000
parents 4a49d5a2169a
children 8862d9e3bd3c
files run/a/auto_19_A.d run/a/auto_19_B.d
diffstat 2 files changed, 62 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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 <wbaxter@gmail.com>
+// @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;
+}
--- /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 <wbaxter@gmail.com>
+// @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;
+}