www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15992] New: [REG2.072a] dmd: todt.c:787: void

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

          Issue ID: 15992
           Summary: [REG2.072a] dmd: todt.c:787: void
                    membersToDt(AggregateDeclaration*, DtBuilder&,
                    Expressions*, size_t, ClassDeclaration*,
                    BaseClass***): Assertion `vd->semanticRun >=
                    PASSsemantic2done' failed.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

----
struct Appender()
{
    bool canExtend = false;
}

struct CustomFloat()
{
    union ToBinary
    {
        CustomFloat!() get;
    }

    void opAssign(F)(F input)
        if (__traits(compiles, cast(real)input))
    {
    }

    real get()()
    {
        Appender!() app;
        assert(false);
    }

    T opCast(T)() { return get!(); }

    alias g = get!();
}

void f()
{
    alias FPTypes = CustomFloat!();
}
----

Encountered here: https://github.com/dlang/phobos/pull/4280

Works with 2.071.0.

Git master (7c3ccd8) fails with:
----
dmd: todt.c:787: void membersToDt(AggregateDeclaration*, DtBuilder&,
Expressions*, size_t, ClassDeclaration*, BaseClass***): Assertion
`vd->semanticRun >= PASSsemantic2done' failed.
Aborted (core dumped)
----

--
May 04 2016