www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13886] New: global.gaggedErrors ICE

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

          Issue ID: 13886
           Summary: global.gaggedErrors ICE
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: vlevenfeld gmail.com

the following code is not valid but instead of producing an error message, hits
ICE

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


import std.typecons;
import std.typetuple;

template X (T)
    {
        static if (is (typeof(T.init.bar) ))
            X U;
        else alias X = T;
    }
struct Y ()
    {    
        this (){}
        ~this (){this = null;}
        ref opAssign (S)(S){}
    }
struct Z () {    }

template foo ()
    {        
        auto foo ()            
            {        
                auto args = tuple ;
                static if (is (Data))
                    0;

                return Z!((args.baz.expand))();
            }
    }
auto baz (T)(T)
    {
        staticMap!(X, T) abc;

        return tuple;
    }
auto bar (R)(R )
    {Y!();}


void main ()
    {
        foo;
    }

--
Dec 21 2014