www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14568] New: gaggederrors ICE

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

          Issue ID: 14568
           Summary: 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

this is an invalid program, but instead of an error message gives this:
dmd: statement.c:752: ErrorStatement::ErrorStatement(): Assertion
`global.gaggedErrors || global.errors' failed.

program:

struct Interval ()
{        
    auto left = INVALID;

    auto opAssign ()(Interval){left;}
}

auto interval (T)(T point)
{
    Interval!();
}

alias Instantiate (alias symbol, Args...) = symbol!Args;

template Match (patterns...)
{
    static if (__traits(compiles, Instantiate!(patterns[0])))
        alias Match = patterns[0];
    else static if (patterns.length == 1)
        {}
}

template SubOps (Args...)
{            
    auto opIndex ()
    {
        template IntervalType (T...)
        {
            alias Point () = typeof(T.interval);

            alias IntervalType = Match!(Point);
        }
        alias Subspace = IntervalType!(Args);
    }
}

struct Nat     {mixin SubOps!(null);}

--
May 10 2015