The following code:
import std.stdio;
import std.traits;
template Bases(T)
{
static if(is(T U == super))
alias U Bases;
else
static assert(false);
}
void main()
{
alias Bases!(shared(Exception)) bases;
foreach(i, e; bases)
writeln(bases[i].stringof);
}
Prints "Throwable" when it should probably print "shared(Throwable)".
Comment #1 by johannes.loher — 2018-05-05T12:37:30Z
Still happening in 2.080.0. The spec states that U should be a TypeSeq of base classes and interfaces of T.
What is the desired behaviour?
This also happens for other attributes like const, immutable, and inout.
std.traits.BaseTypeTuple has the same behaviour.
Comment #2 by robert.schadek — 2024-12-13T17:53:50Z