www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20602] New: [REG2.086] ICE on wrong code

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

          Issue ID: 20602
           Summary: [REG2.086] ICE on wrong code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: johanengelen weka.io

Before 2.086 this code would simply error. But now it crashes the compiler.
```
import std;

auto ggg(Func)(Func func) { func(); }

nogc foo()() { }

void someOp(T)() {
    try { }
    catch foo;
    try ggg(() => msg);
    catch boo;
}

struct S(T) {
    T slice() inout { someOp!int(); }
    void opAssign()(U) {}
    alias slice this;
}

struct ClusterInfo {
     UDA() UUID guid;
     UDA() S!(char) name;
}
```

The original code triggering the crash was much more complex, but the compiler
crashes at the same point. An assert is triggered; with LDC it is this assert:
https://github.com/ldc-developers/ldc/blob/d7b4b7db1cc69b3c3e356eeaf3c136a71fa2f516/dmd/expressionsem.d#L1669

--
Feb 23 2020