www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23117] New: crash in safe code after CTFE

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

          Issue ID: 23117
           Summary: crash in  safe code after CTFE
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: su+dlangissues angel-island.zone

the following code crashes.

void main()  safe
{
    enum crash = foo([1]);
    import std.stdio : writeln;

    writeln(crash);
}

auto foo(in int[] r)  safe nothrow pure
{
    import std.algorithm : map;
    import std.range : enumerate;

    return r.map!(x => enumerate(r));
}

--
May 16 2022