# HG changeset patch # User thomask # Date 1175329397 0 # Node ID 8200aeafb50486ea0bb922bfef5d22136b17fccb # Parent 4756fddca5c4d3dae99e3982f996baba4d5c801f r7382@birke: tk | 2007-03-29 15:06:54 +0200 [Issue 1021] CTFE and functions returning void Frits van Bommel 2007-03-04 http://d.puremagic.com/issues/show_bug.cgi?id=1021 diff -r 4756fddca5c4 -r 8200aeafb504 compile/i/inerpret_05_A.d --- /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 +// @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); diff -r 4756fddca5c4 -r 8200aeafb504 compile/i/inerpret_05_B.d --- /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 +// @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);