Is this a known DMD bug or feature?
void f(T)(int num)
{
writefln("recognized %d as %s", num, T.stringof);
}
void main()
{
try
{
throw new Exception("");
}
catch (Exception)
{
f!Exception(1);
}
catch (Throwable)
{
f!Throwable(1);
}
debug
{
try
{
throw new Exception("");
}
catch (Exception)
{
f!Exception(2);
}
catch (Throwable)
{
f!Throwable(2);
}
}
}
// prints
// recognized 1 as Exception
// recognized 2 as Throwable