[Issue 2394] New: IFTI fails for nulls

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 5 02:08:12 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2394

           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 at digitalmars.com
        ReportedBy: samukha at 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
declaration


-- 



More information about the Digitalmars-d-bugs mailing list