www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22003] New: "Error: unknown, please file report on

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

          Issue ID: 22003
           Summary: "Error: unknown, please file report on
                    issues.dlang.org" with SumType/struct mutual recursion
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dlang-bugzilla thecybershadow.net

//////////// 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;
}
()`
-----------------------------------------------------

--
Jun 08