[Issue 14552] SIGSEGV with compile construction nested class in predicate

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri May 8 01:00:55 PDT 2015


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

--- Comment #2 from Vladimir Panteleev <thecybershadow at gmail.com> ---
Reduced without Phobos:

////////////////// testNP.d //////////////////
template map(fun...)
{
    template AppliedReturnType(alias f)
    {
        alias typeof(f(0)) AppliedReturnType;
    }

    auto map(int[] r)
    {
        assert(!is(AppliedReturnType!fun));
        return MapResult!fun();
    }
}

struct MapResult(alias fun)
{
    @property front()
    {
        fun(0);
    }
}

class Outer
{
    auto test()
    {
        [1].map!( (j) { return new Inner; } );
    }
    class Inner {}
}
//////////////////////////////////////////////

Crashes as far back as this can compile.
Stops crashing after https://github.com/D-Programming-Language/dmd/pull/4464
(as before).

Jack: can you confirm that the bug is gone in your real program with D git?

--


More information about the Digitalmars-d-bugs mailing list