----- class C(T) { } void foo(T)(C!T a, C!T b) { } void main() { C!int c; foo(c, null); } ----- test.d(10): Error: template test.foo cannot deduce function from argument types !()(C!int, typeof(null)), candidates are: test.d(5): test.foo(T)(C!T a, C!T b) null should be implicitly convertible to C!T since it's a reference type. Note that the programmer can't simply introduce another templated type parameter since the parameter might end up being typed as typeof(null), which is problematic. For example: ----- class C(T) { void bar() { } } void foo(T, T2)(C!T a, T2 b) if (is(T2 : C!T)) { b.bar(); // Error: no property 'bar' for type 'typeof(null)' } void main() { C!int c; foo(c, null); } ----- So I think the OP case is rejects-valid.
Still happens with recent git.
The bug is much more specific than suggested by the summary. 1. it is limited to classes because the following works ``` struct S(T){} void v(T)(S!T* a, S!T* b) {} void main() { S!int* a; v(a,null); } ``` 2. it limited to classes templates because the following works ``` class S{} void v(T)(T a, T b) {} void main() { S a; v(a,null); } ```