Bug 21818 – ICE: Assertion hit in dinterpret.d

Status
RESOLVED
Resolution
DUPLICATE
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-10T22:25:16Z
Last change time
2021-10-15T12:49:41Z
Keywords
ice, ice-on-valid-code, industry
Assigned to
No Owner
Creator
johanengelen

Comments

Comment #0 by johanengelen — 2021-04-10T22:25:16Z
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
Comment #1 by boris2.9 — 2021-10-15T12:49:41Z
*** This issue has been marked as a duplicate of issue 21794 ***