changeset 1434:8200aeafb504

r7382@birke: tk | 2007-03-29 15:06:54 +0200 [Issue 1021] CTFE and functions returning void Frits van Bommel <fvbommel@wxs.nl> 2007-03-04 http://d.puremagic.com/issues/show_bug.cgi?id=1021
author thomask
date Sat, 31 Mar 2007 08:23:17 +0000
parents 4756fddca5c4
children 09185f55ff32
files compile/i/inerpret_05_A.d compile/i/inerpret_05_B.d
diffstat 2 files changed, 48 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/i/inerpret_05_A.d	Sat Mar 31 08:23:17 2007 +0000
@@ -0,0 +1,24 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	 Frits van Bommel <fvbommel@wxs.nl>
+// @date@	2007-03-04
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1021
+// @desc@	[Issue 1021] CTFE and functions returning void
+
+module dstress.compile.i.interpret_05_A;
+
+void bar(out int x){
+	x = 2;
+}
+
+int foo() {
+	int y;
+	bar(y);
+	return y;
+}
+
+const int z = foo();
+
+static assert(2 == z);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/i/inerpret_05_B.d	Sat Mar 31 08:23:17 2007 +0000
@@ -0,0 +1,24 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	 Frits van Bommel <fvbommel@wxs.nl>
+// @date@	2007-03-04
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1021
+// @desc@	[Issue 1021] CTFE and functions returning void
+
+module dstress.compile.i.interpret_05_B;
+
+void bar(inout int x){
+	x = 2;
+}
+
+int foo() {
+	int y;
+	bar(y);
+	return y;
+}
+
+const int z = foo();
+
+static assert(2 == z);