Nevermind - sorry for the clutter.

For those who are apparently as dense as I am, this can be roughly
accomplished via Template specialization:

class Fruit {}

class Apple : Fruit {}

class Celery {}

void mustBeFruit(T : Fruit)() {
    writeln(T.classinfo.name);
}

void main() {
    mustBeFruit!(Apple)(); // Ok
    mustBeFruit!(Celery)(); // Does not compile
}

Reply via email to