I have a question about template argument matching in combination with implicit conversion and alias this. Consider the following code:

interface SomeInterface
{
}

class SomeClass : SomeInterface
{
}

struct SomeStruct
{
    SomeClass someClass;
    alias someClass this;
}

template isSuperType(T, S : T)
{
    enum isSuperType = is(SomeStruct : SomeInterface);
}

void main()
{
    static assert(is(SomeStruct : SomeInterface));
static assert(isSuperType!(SomeInterface, SomeStruct)); // why does the template not match?
}


The question is, why does the template declaration not match? Thanks for your help!

Reply via email to