www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2394] New: IFTI fails for nulls


           Summary: IFTI fails for nulls
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samukha voliacable.com

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

Oct 05 2008