Thread overview
[Issue 14737] [REG2.058] A concatenation of array literal and static array should make dynamic array
[Issue 14737] [2.068 beta] Array concatenation fails in enum declaration
Jun 26, 2015
Kenji Hara
Jun 26, 2015
Kenji Hara
June 26, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

--- Comment #1 from briancschott@gmail.com ---
Digger has traced this back to DMD commit 0b3641ad960ba7f4d8d5f5a23fec52e506017bd6

--
June 26, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
            Summary|[2.068 beta] Array          |[REG2.058] A concatenation
                   |concatenation fails in enum |of array literal and static
                   |declaration                 |array should make dynamic
                   |                            |array
                 OS|Linux                       |All

--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to briancschott from comment #0)
> With 2.068.0-b1, it fails with this error:
> test.d(12): Error: cannot cast expression ["a", "b", "c"] of type string[]
> to string[2]
> test.d(16): Error: cannot cast expression ["a", "b", "c"] of type string[]
> to string[2]

A concatenation T[] ~ T[n] should be typed as T[], so the both cases should succeed to compile.

With the reduced test case:

void main()
{
    string[2] a2 = ["d", "e"];
    auto b2 = ["a", "b", "c"] ~ a2;
    assert(b2 == ["a", "b", "c", "d", "e"]);
}

It had worked until 2.057, but since 2.058 e2ir error has occurred.

The rejects-valid regression was introduced in: https://github.com/D-Programming-Language/dmd/pull/618

--
June 26, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/4776

--
June 26, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

--- Comment #4 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/05101662d1d7ed8df51f391b993d3640496df51d
fix Issue 14737 - A concatenation of array literal and static array should make
dynamic array

https://github.com/D-Programming-Language/dmd/commit/d8eb13976386dcf4eaaf3732e6f55eeeab545f02 Merge pull request #4776 from 9rnsr/fix14737

[REG2.058] Issue 14737 - A concatenation of array literal and static array should make dynamic array

--
July 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

--- Comment #5 from github-bugzilla@puremagic.com ---
Commit pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d68e8d61ccabd1ae7c2252b86cda56e13adef1c4 Merge pull request #4776 from 9rnsr/fix14737

[REG2.058] Issue 14737 - A concatenation of array literal and static array should make dynamic array

--
July 24, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

--- Comment #6 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d68e8d61ccabd1ae7c2252b86cda56e13adef1c4 Merge pull request #4776 from 9rnsr/fix14737

--
October 04, 2015
https://issues.dlang.org/show_bug.cgi?id=14737

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/05101662d1d7ed8df51f391b993d3640496df51d
fix Issue 14737 - A concatenation of array literal and static array should make
dynamic array

https://github.com/D-Programming-Language/dmd/commit/d8eb13976386dcf4eaaf3732e6f55eeeab545f02 Merge pull request #4776 from 9rnsr/fix14737

--
July 22, 2017
https://issues.dlang.org/show_bug.cgi?id=14737

--- Comment #8 from github-bugzilla@puremagic.com ---
Commits pushed to dmd-cxx at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/05101662d1d7ed8df51f391b993d3640496df51d fix Issue 14737 - A concatenation of array literal and static array should make dynamic array

https://github.com/dlang/dmd/commit/d8eb13976386dcf4eaaf3732e6f55eeeab545f02 Merge pull request #4776 from 9rnsr/fix14737

--