D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9428 - Wrong array concatenation
Summary: Wrong array concatenation
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: pull, wrong-code
Depends on:
Blocks:
 
Reported: 2013-01-30 17:17 UTC by bearophile_hugs
Modified: 2013-02-18 20:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-01-30 17:17:24 UTC
import std.stdio: writeln;
void main() {
    int[2][] items = [[1, 2]];
    int[2] x = [3, 4];
    auto r1 = items ~ [x];
    writeln(r1);
    auto r2 = items ~ x;
    writeln(r2);
}


Output:

[[1, 2], [3, 4]]
[[1, 2], [3, 4], [22683584, 4391680]]


Expected output:

[[1, 2], [3, 4]]
[[1, 2], [3, 4]]


Maybe it's a regression.
Comment 1 Oleg Kuporosov 2013-01-31 21:56:50 UTC
both 2.059 and 2.060 have showed the same output as 2.061, so it is not regression agaist it.
Comment 2 Kenji Hara 2013-01-31 23:51:43 UTC
https://github.com/D-Programming-Language/dmd/pull/1590

It is an issue of dmd glue layer, so did not belongs to druntime.
Comment 3 github-bugzilla 2013-02-18 20:30:55 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/976ddc082ef8f74ff9bae199cb9289d0e1d1b4ca
fix Issue 9428 - Wrong array concatenation

https://github.com/D-Programming-Language/dmd/commit/7b2bc9bab72eb11ec3f89f67190578eaf7f98ead
Merge pull request #1590 from 9rnsr/fix9428

Issue 9428 - Wrong array concatenation