Bug 22003 – "Error: unknown, please file report on issues.dlang.org" with SumType/struct mutual recursion

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-08T09:23:35Z
Last change time
2024-12-13T19:16:53Z
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#19941 →

Comments

Comment #0 by dlang-bugzilla — 2021-06-08T09:23:35Z
//////////// test.d /////////// import std.sumtype; struct Choice { Node[] nodes; } struct Seq { Node[] nodes; } alias Node = SumType!( Choice, Seq, ); /////////////////////////////// Compiler output: ----------------------------------------------------- Error: unknown, please file report on issues.dlang.org .../std/sumtype.d(1905): Error: template instance `std.sumtype.SumType!(Choice, Seq).SumType.get!(Choice)` error instantiating .../std/meta.d-mixin-794(794): instantiated from here: `F!0LU` .../std/sumtype.d(1908): instantiated from here: `Map!(getType, 0LU)` .../std/sumtype.d(1944): instantiated from here: `valueTypes!0LU` .../std/sumtype.d(1554): ... (1 instantiations, -v to show) ... .../std/sumtype.d(692): instantiated from here: `match!(SumType!(Choice, Seq))` test.d(5): instantiated from here: `SumType!(Choice, Seq)` .../std/sumtype.d(1962): while evaluating: `static assert((__error)(hid))` .../std/sumtype.d(1984): Error: forward reference to inferred return type of function call `function () { foreach (caseId; 0 .. 2LU) { return caseId; } assert(0); } ()` .../std/sumtype.d(1984): Error: forward reference to inferred return type of function call `function () { typeof(__error)[] __res104; foreach (caseId; 0 .. 2LU) { __res104 ~= caseId; } return __res104; } ()` -----------------------------------------------------
Comment #1 by robert.schadek — 2024-12-13T19:16:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19941 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB