www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13235] New: ICE on mutually recursive tuple type

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

          Issue ID: 13235
           Summary: ICE on mutually recursive tuple type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: ice-on-valid-code, wrong-code
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: timon.gehr gmx.ch

DMD 2.066.0-rc1

struct Tuple(T...){
    pragma(msg, T); // shown twice!
    T expand;
    alias expand field;
    this(T values){
        field = values;
    }
}
struct Foo{ Tuple!(int,Foo)* foo; }
static bar(T...)(T args){  }
void main(){
    assert(Tuple!(int,Foo)(1,Foo()).expand[0] == 1);
}

The code should compile and run. This issue affects Phobos.
The assertion fails with DMD 2.060, so the bug is not new, just the ICE.

(So maybe this is not a regression, but it is hard to tell.)

--
Aug 01 2014