Thread overview
[Issue 24531] foreach lowering fails to compile with dip1000 and std.array.array
May 01
https://issues.dlang.org/show_bug.cgi?id=24531

Atila Neves <atila.neves@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry, rejects-valid,
                   |                            |safe

--
May 10
https://issues.dlang.org/show_bug.cgi?id=24531

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
Unfortunately, the example provided is incomplete and not compilable.

--
May 10
https://issues.dlang.org/show_bug.cgi?id=24531

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
I need a file, say, test.d, that when compiled with specific switches reproduces the error.

--
May 10
https://issues.dlang.org/show_bug.cgi?id=24531

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #3 from Nick Treleaven <nick@geany.org> ---
It compiles with:

    import std.algorithm : filter, map;

Adding -dip1000 gives:

arrayctfe.d(14): Error: scope variable `srcs` assigned to non-scope parameter
`range` calling `arrayCtfe`
arrayctfe.d(28):        which is not `scope` because of `__r115 = range`

Replacing the foreach statement with the while code in comment #0 does compile with -dip1000.

--