Internal error: e2ir.c 1242

Tobias Pankrath tobias at pankrath.net
Wed Nov 9 02:39:14 PST 2011


I'd say, I found another compiler bug.

-----------------
import std.stdio;

template Struct(alias bar)
{
    struct S
    {
        void foo()
        {
            FancyFunc!(this, bar).fn();
        }
    }
}
template FancyFunc(alias context, alias f)
{
    void fn()
    {
        writeln("before");
        f(context);
        writeln("after");
    }
}
void bar(CT)(CT context)
{
    writeln(CT.stringof);
}
void main()
{
    alias Struct!(bar).S MyStruct;
    MyStruct s = MyStruct();
    s.foo();
}
----------------------

Compile it with dmd and dmd will print:

> Internal error: e2ir.c 1242

Should the aliasing of "this" in FancyFunc!(this, bar) work, if there were 
no internal compiler error?

In any case I've filed a report 
(http://d.puremagic.com/issues/show_bug.cgi?id=6918).

--
Tobias





More information about the Digitalmars-d-learn mailing list