Separated from:
https://issues.dlang.org/show_bug.cgi?id=13244#c9
================================
I'm getting this again with dmd 2.069.
With the files below, running rdmd -g -inline main.d I get:
object.Error@(0): Access Violation
----------------
0x00821014
0x0040221A in D3std5array135__T5arrayTS3std9algorithm9iteration87__T9MapResultS67_D11failsinline11FailsInline7146BC2938FC1915EBA515935C5C811A
0x0040247F in void failsinline.FailsInline.failsinline() at E:\source\dice\failsinline.d(9)
0x00402027 in _Dmain at E:\source\dice\main.d(7)
0x00402BF7 in D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x00402BBB in void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()
0x00402ABC in _d_run_main
0x004023F0 in main at E:\source\dice\main.d(7)
0x0041D0F5 in mainCRTStartup
0x77693744 in BaseThreadInitThunk
0x77BBA064 in RtlSetCurrentTransaction
0x77BBA02F in RtlSetCurrentTransaction
When removing the std.algorithm import from main.d or compiling without -inline it works fine.
-- main.d --
import std.algorithm;
import failsinline;
void main()
{
auto fail = new FailsInline();
fail.failsinline();
}
-- main.d --
-- failsinline.d --
import std.algorithm : map;
import std.array : array;
class FailsInline
{
void failsinline()
{
auto transform = (int i) => i;
[0].map!transform.array;
}
}
-- failsinline.d --
Comment #1 by k.hara.pg — 2015-11-06T06:20:53Z
Created attachment 1563
Reduced test case
Comment #2 by greeenify — 2016-12-23T01:11:20Z
This has probably been resolved in the meanwhile :)
Compiling the examples throw no error with v2.072.1 (and prints [0] if an writeln) is added. Thus closing, please reopen if is still valid for you.