www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17969] New: dmd 2.077.0 crashes when computing mangling


          Issue ID: 17969
           Summary: dmd 2.077.0 crashes when computing mangling symbol for
                    simple program
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: atila.neves gmail.com

This code causes dmd 2.070.0 to crash:

void foo() {
    struct Data {
        double value;

void oops(Data)(Data[] data) {
    import std.algorithm: map;
    auto values = [data].map!(a => a.map!(b => b.value).sum);

Earlier versions aren't affected. Notice that `sum` isn't imported. If it is,
the crash goes away. If `b.value` is replaced with `b.foo` (or any other name
that doesn't exist in the struct), it also crashes, so it seems to have to do
with the function failing to compile.

The stack trace points to

Nov 06 2017