www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13356] New: [ICE] (dmd 2.066: statement.c:754) with recursive

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

          Issue ID: 13356
           Summary: [ICE] (dmd 2.066: statement.c:754) with recursive
                    Algebraic
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: philippe.sigaud gmail.com

This creates an [ICE] (2.066):

struct List {

    import std.variant : Algebraic;
    import std.typecons : Tuple;

    alias Payload = Algebraic!(
        double,
        Tuple!(List)
    );

    Payload payload;

    this(double d) { payload = Payload(d); }

}

void main() {

}

Error message:

dmd: statement.c:754: ErrorStatement::ErrorStatement(): Assertion
`global.gaggedErrors || global.errors' failed.


Using Algebraic!(double, List) or using a class instead of a struct makes the
ICE disappear (there are other errors, though).

--
Aug 22 2014