595 – can't append to array/arrayliteral statically

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 595 - can't append to array/arrayliteral statically
Summary: can't append to array/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:
: 608 (view as issue list)
Depends on:
Blocks:
Reported: 2006年11月25日 08:34 UTC by Nazo Humei
Modified: 2015年06月09日 05:15 UTC (History)
1 user (show)

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日 08:34:58 UTC
void main(){
 const char[] test = "" ~ 'a' ~ 'b' ~ 'c';//ok
 char[] test2 = (cast(char[])null)~'a'~'b'~'c';//ok
 const char[] test3 = (cast(char[])null)~'a'~'b'~'c';//failed
 char[] test4 = (cast(char[])[])~'a'~'b'~'c';//ok
 const char[] test5 = (cast(char[])[])~'a'~'b'~'c';//failed
 const char[] test6 = null;
 const char[] test7 = test6~'a'~'b'~'c';//failed
}
Comment 1 Thomas Kühne 2006年11月25日 12:05:39 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=595 
> void main(){
> const char[] test = "" ~ 'a' ~ 'b' ~ 'c';//ok
> char[] test2 = (cast(char[])null)~'a'~'b'~'c';//ok
> const char[] test3 = (cast(char[])null)~'a'~'b'~'c';//failed
> char[] test4 = (cast(char[])[])~'a'~'b'~'c';//ok
> const char[] test5 = (cast(char[])[])~'a'~'b'~'c';//failed
> const char[] test6 = null;
> const char[] test7 = test6~'a'~'b'~'c';//failed
> }
Added to DStress as
http://dstress.kuehne.cn/compile/o/opCat_25_A.d
http://dstress.kuehne.cn/compile/o/opCat_25_B.d
(the other cases are covered by issue 353)
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFaIxQLK5blCcjpWoRAjjHAKCRmAOpraprE45RlDMy5ctaTRotSgCgq/K9
a3M88iwUCJXDQ9xDTNz1qIw=
=7fXt
-----END PGP SIGNATURE-----
Comment 2 Thomas Kühne 2006年11月29日 15:31:16 UTC
*** Bug 608 has been marked as a duplicate of this bug. ***
Comment 3 Walter Bright 2007年04月20日 13:17:08 UTC
Fixed DMD 1.013


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