On Sunday, 30 November 2014 at 02:10:13 UTC, bitwise wrote:
In the following program, the output does not contain "SomeClass". Is this a bug?

Maybe yes, as a workaround this works:

module main;
import std.stdio;

template Test()
{
    enum Test = q{
        class SomeClass {
            int n = 123;
        }
    };
}

mixin(Test!());

void main() {

    auto sc = new SomeClass;
    writeln(sc.n);

    foreach(m; ModuleInfo)
    {
        foreach(c; m.localClasses())
        {
            writeln(c.name);
        }
    }
}

Btw. you can use just template, IIRC there is no difference between template and mixin template

Reply via email to