[Issue 23117] New: crash in @safe code after CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 17 06:40:49 UTC 2022


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 at puremagic.com
          Reporter: su+dlangissues at 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));
}

--


More information about the Digitalmars-d-bugs mailing list