# HG changeset patch # User thomask # Date 1173371363 0 # Node ID f1c494dc588aab38912ce4b4e4df7975bb04a691 # Parent 45dbf7a802378ea487920e6d08cca0a0f43594cb [Issue 980] If a function tries to concatenate a char to a empty array, dmd complains that the function can't be evaluated at compile time John S. Skogtvedt 2007-02-18 http://d.puremagic.com/issues/show_bug.cgi?id=980 diff -r 45dbf7a80237 -r f1c494dc588a compile/o/opCatAssign_22_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/o/opCatAssign_22_A.d Thu Mar 08 16:29:23 2007 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ John S. Skogtvedt +// @date@ 2007-02-18 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=980 +// @desc@ [Issue 980] If a function tries to concatenate a char to a empty array, dmd complains that the function can't be evaluated at compile time + +module dstress.compile.o.opCatAssign_22_A; + +char[] test(){ + char[] s = ""; + return s ~= "o"; +} + +const x = test(); +static assert(x == "o"); diff -r 45dbf7a80237 -r f1c494dc588a compile/o/opCatAssign_22_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/o/opCatAssign_22_B.d Thu Mar 08 16:29:23 2007 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ John S. Skogtvedt +// @date@ 2007-02-18 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=980 +// @desc@ [Issue 980] If a function tries to concatenate a char to a empty array, dmd complains that the function can't be evaluated at compile time + +module dstress.compile.o.opCatAssign_22_B; + +char[] test(){ + char[] s = "a"; + return s ~= "o"; +} + +const x = test(); +static assert(x == "ao"); diff -r 45dbf7a80237 -r f1c494dc588a compile/o/opCat_26_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/o/opCat_26_A.d Thu Mar 08 16:29:23 2007 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ John S. Skogtvedt +// @date@ 2007-02-18 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=980 +// @desc@ [Issue 980] If a function tries to concatenate a char to a empty array, dmd complains that the function can't be evaluated at compile time + +module dstress.compile.o.opCat_26_A; + +char[] test(){ + char[] s = ""; + return s ~ "o"; +} + +const x = test(); +static assert(x == "o"); diff -r 45dbf7a80237 -r f1c494dc588a compile/o/opCat_26_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/o/opCat_26_B.d Thu Mar 08 16:29:23 2007 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ John S. Skogtvedt +// @date@ 2007-02-18 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=980 +// @desc@ [Issue 980] If a function tries to concatenate a char to a empty array, dmd complains that the function can't be evaluated at compile time + +module dstress.compile.o.opCat_26_B; + +char[] test(){ + char[] s = "a"; + return s ~ "o"; +} + +const x = test(); +static assert(x == "ao"); diff -r 45dbf7a80237 -r f1c494dc588a reporter.txt --- a/reporter.txt Thu Mar 08 16:28:36 2007 +0000 +++ b/reporter.txt Thu Mar 08 16:29:23 2007 +0000 @@ -83,6 +83,7 @@ John C John Demme John Reimer +John S. Skogtvedt Johan Granberg k2 Kazuhiro Inaba