null literal requires an explicit cast, in order to be considered a match for a parameter of nullable type. ---- class C { } void foo(T)(T x, C c) // C - a nullable type { } void main() { foo(1, null); // fails foo(1, cast(C)null); // ok } ---- test.d(17): template Test.foo(T) does not match any function template declaration
Here is a simple example with string. ---- void main() { example(null); } void example()(string[] foo) { } ---- test.d(3): Error: template test.example() does not match any function template declaration test.d(3): Error: template test.example() cannot deduce template function from argument types !()(void*)
Related to issue 2367 (and fixed by that patch)
Or maybe it's bug 4953
By fixing issue 5416 (dmd2.057 and later), null literal works as expected in IFTI.