See also: http://forum.dlang.org/thread/gfdqabtlqiwatkowmtxy@forum.dlang.org template A(alias T) { alias A = T; } void main() { struct S { } static assert(is(typeof(A!(cast(S*)null)) == S*)); //pragma(msg, typeof(A!null)); // S* static assert(is(typeof(A!(null) == typeof(null)))); // still S* }