Thread overview
[Issue 18949] Array literals don't work with betterc
Jun 06, 2018
anonymous4
Jun 06, 2018
anonymous4
Dec 17, 2022
Iain Buclaw
Dec 27, 2022
Nick Treleaven
June 06, 2018
https://issues.dlang.org/show_bug.cgi?id=18949

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=16037

--
June 06, 2018
https://issues.dlang.org/show_bug.cgi?id=18949

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |betterC
           Hardware|x86                         |All
                 OS|Windows                     |All

--- Comment #1 from anonymous4 <dfj1esp02@sneakemail.com> ---
Technically it needs `in` attribute:
---
void takeArray(in int[] array)
{
}
void bar()
{
    takeArray([1, 2, 3]);
}
---

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18949

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 27, 2022
https://issues.dlang.org/show_bug.cgi?id=18949

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |nick@geany.org
         Resolution|---                         |FIXED

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
`array` needs to be `in` or `scope`. The error message has been improved:

arrlit.d(6): Error: expression `[1, 2, 3]` uses the GC and cannot be used with
switch `-betterC`

--