D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6467 - (D1 only) Static array is corrupted when concatenated
Summary: (D1 only) Static array is corrupted when concatenated
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2011-08-10 23:19 UTC by Denis Shelomovskii
Modified: 2019-11-07 08:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2011-08-10 23:19:15 UTC
This works fine with dmd v1.069:
---
const staticArray = "abc";

void main() {
    static dynamicArray = staticArray ~ "d"; //corrupts staticArray
    pragma(msg, typeof(staticArray)); //char[3u]
    pragma(msg, typeof(dynamicArray)); //char[]
    static assert(staticArray == "abc");
    assert(staticArray != "abc");
    assert(staticArray == [cast(char)3, 0, 0]);
}
---
Comment 1 RazvanN 2019-11-07 08:13:11 UTC
This bug does not manifest in D2 and D1 is no longer supported. Closing as WORKSFORME.