[Issue 21818] New: ICE: Assertion hit in dinterpret.d

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 10 22:25:16 UTC 2021


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

          Issue ID: 21818
           Summary: ICE: Assertion hit in dinterpret.d
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: johanengelen at weka.io

The testcase below compiles fine with normal compiler builds (assertions
disabled), but triggers the assertion in dinterpret.d on line 7362 (dlang
2.095) for debug compiler builds.
https://github.com/dlang/dmd/blob/f6188d5cd620aca785d211570bf2bf2fb21679ba/src/dmd/dinterpret.d#L7362


I've tried to minimize the testcase, but it requires Phobos's format, and
that's where I stopped:

```
import std.format;

void foo(bool, A.Info args) {
    format!"%s"(args);
}


struct A {
    struct Info {
        A* self;
    }

    auto getInfo() {
        return Info();
    }

    void a() {
        foo(false, getInfo);
    }
}
```

https://d.godbolt.org/z/jcGaj7PKq

--


More information about the Digitalmars-d-bugs mailing list