[Issue 13244] Wrong code with -inline and foreach/map/all

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 13 08:08:36 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13244

Ola Østtveit <olaa81 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |olaa81 at gmail.com

--- Comment #3 from Ola Østtveit <olaa81 at gmail.com> ---
Similar issue with map/array:

-- main.d --
import std.algorithm;
import failsinline;

void main()
{
  auto fail = new FailsInline();
}
-- main.d --

-- failsinline.d --
import std.algorithm;
import std.array;

void failsinline()
{
  auto transform = (int i) => i;
  [0].map!transform.array;
}
-- failsinline.d --

'rdmd main.d' works fine.
'rdmd -inline main.d' gives object.Error@(0): Access Violation.

Removing the std.algorithm import from main.d makes it work fine.

Same issue in dmd 2.066, 2.066-rc2 and 2.067-b1.

--


More information about the Digitalmars-d-bugs mailing list