Currently D offers a means to get all supertypes (base class and implemented interfaces) of a class types with this construct:
static if (is(C P == super))
{
}
Inside the static if, P is a tuple starting with the base class and continuing with all implemented interfaces, in lexical order.
Now consider:
struct S(T)
{
private T datum;
T fun() { return datum; }
alias fun this;
}
There is no introspection mechanism that, given S, finds T. There should be one, and it should work with the upcoming multiple alias this.
I think it's fine if we use the same syntax.
Comment #1 by robert.schadek — 2024-12-13T18:42:07Z