594 – can't cast arrayliteral statically

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 594 - can't cast arrayliteral statically
Summary: can't cast arrayliteral statically
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2006年11月25日 05:29 UTC by Nazo Humei
Modified: 2015年06月09日 05:15 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Nazo Humei 2006年11月25日 05:29:33 UTC
void main(){
 const char[] t="abcd";
 const ubyte[] t2=cast(ubyte[])t;//ok
 const char[] t3=['a','b','c','d'];
 const ubyte[] t4=cast(ubyte[])t3;//error
}
Comment 1 Thomas Kühne 2006年11月25日 07:50:54 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail@puremagic.com schrieb am 2006年11月25日:
> http://d.puremagic.com/issues/show_bug.cgi?id=594 
> void main(){
> const char[] t="abcd";
> const ubyte[] t2=cast(ubyte[])t;//ok
> const char[] t3=['a','b','c','d'];
> const ubyte[] t4=cast(ubyte[])t3;//error
> }
Added to DStress as
http://dstress.kuehne.cn/compile/c/cast_33_A.d
http://dstress.kuehne.cn/compile/c/cast_33_B.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFaD3BLK5blCcjpWoRApYEAJ0eVrL3fJZsJ2Xvr0+U8V0gPwk61ACdFjfC
iiMBbopLtQHhZ/2evEdZAhY=
=iyyu
-----END PGP SIGNATURE-----
Comment 2 Walter Bright 2007年04月20日 13:16:54 UTC
Fixed DMD 1.013


AltStyle によって変換されたページ (->オリジナル) /