Mercurial > projects > dstress
changeset 1226:9ca9e2b68e77
[Issue 594] New: can't cast arrayliteral statically
Nazo Humei <lovesyao@hotmail.com>
2006-11-25
news:bug-594-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Sat, 25 Nov 2006 13:36:56 +0000 |
parents | de1ed718e0cd |
children | b687738c2fcb |
files | compile/c/cast_33_A.d compile/c/cast_33_B.d |
diffstat | 2 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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 <lovesyao@hotmail.com> +// @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']);
--- /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 <lovesyao@hotmail.com> +// @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']);