https://issues.dlang.org/show_bug.cgi?id=12638 https://run.dlang.io/is/jkEIiI ref foo() {} void main() { import std.traits; pragma(msg, ReturnType!foo); foo(); } Assuming this is supposed to be allowed by the standard, replacing void with ref (i.e. ref main { ) does not compile which suggests something isn't right.