the story of
https://forum.dlang.org/thread/qknxjxzbaowmsjdng...@forum.dlang.org
continues

How can this be?

void main()
{
    auto s = S();
    auto t = T!s();
    assert(typeof(t).dummy == null);
    assert(t.dummy == null);
    t.foo;

}

struct S
{
    auto fun()
    {
        return 42;
    }
}

struct T(alias stats)
{
    static typeof(stats)* dummy; // line 21
    static auto foo()
    {
        assert(dummy == null); // line 24
        assert(dummy.fun == 42); //line 25
    }
}

I thought, if I don't initialize a pointer, like the one in line 21 (I assert this by the check in line 24) I can't use it line line 25.
However, I can...

Reply via email to