# HG changeset patch # User thomask # Date 1164461816 0 # Node ID 9ca9e2b68e77fc019a7513522bc95c51c8e0dcfa # Parent de1ed718e0cdf48b5a514071d63e00ecf3ad6d61 [Issue 594] New: can't cast arrayliteral statically Nazo Humei 2006-11-25 news:bug-594-3@http.d.puremagic.com/issues/ diff -r de1ed718e0cd -r 9ca9e2b68e77 compile/c/cast_33_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/cast_33_A.d Sat Nov 25 13:36:56 2006 +0000 @@ -0,0 +1,15 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nazo Humei +// @date@ 2006-11-25 +// @uri@ news:bug-594-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 594] New: can't cast arrayliteral statically + +module dstress.compile.c.cast_33_A; + +const char[] a = "abcd"; +const ubyte[] b = cast(ubyte[]) a; + +static assert(b == ['a', 'b', 'c', 'd']); diff -r de1ed718e0cd -r 9ca9e2b68e77 compile/c/cast_33_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/cast_33_B.d Sat Nov 25 13:36:56 2006 +0000 @@ -0,0 +1,15 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nazo Humei +// @date@ 2006-11-25 +// @uri@ news:bug-594-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 594] New: can't cast arrayliteral statically + +module dstress.compile.c.cast_33_B; + +const char[] a = ['a', 'b', 'c', 'd']; +const ubyte[] b = cast(ubyte[]) a; + +static assert(b == ['a', 'b', 'c', 'd']);