changeset 1515:516ef5730874

[Issue 1108] Indexing an int[] not evaluatable at compile time Reiner Pope <reiner.pope@gmail.com> 2007-04-07 http://d.puremagic.com/issues/show_bug.cgi?id=1108
author thomask
date Wed, 25 Apr 2007 17:47:00 +0000
parents 891196dcfc3a
children 4576b42ef546
files compile/i/interpret_05_A.d compile/i/interpret_05_B.d
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/i/interpret_05_A.d	Wed Apr 25 17:47:00 2007 +0000
@@ -0,0 +1,17 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Reiner Pope <reiner.pope@gmail.com>
+// @date@	2007-04-07
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1108
+// @desc@	[Issue 1108] Indexing an int[] not evaluatable at compile time
+
+module dstress.compile.i.interpret_05_A;
+
+int foo(){
+	int[] data = [0xBABE_2007];
+        return data[0];
+}
+
+static assert(0xBABE_2007 == foo());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/i/interpret_05_B.d	Wed Apr 25 17:47:00 2007 +0000
@@ -0,0 +1,14 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Reiner Pope <reiner.pope@gmail.com>
+// @date@	2007-04-07
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1108
+// @desc@	[Issue 1108] Indexing an int[] not evaluatable at compile time
+
+module dstress.compile.i.interpret_05_B;
+
+const int[] data = [0xBABE_2007];
+
+static assert(0xBABE_2007 == data[0]);