Thread overview
[Issue 2394] New: IFTI fails for nulls
Oct 05, 2008
d-bugmail
Jul 19, 2011
Jesse Phillips
Jul 19, 2011
yebblies
Jul 19, 2011
yebblies
Dec 27, 2011
Kenji Hara
October 05, 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@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
declaration


-- 

July 19, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2394


Jesse Phillips <Jesse.K.Phillips+D@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jesse.K.Phillips+D@gmail.co
                   |                            |m


--- Comment #1 from Jesse Phillips <Jesse.K.Phillips+D@gmail.com> 2011-07-18 18:06:50 PDT ---
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*)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 19, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2394


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #2 from yebblies <yebblies@gmail.com> 2011-07-19 13:31:16 EST ---
Related to issue 2367 (and fixed by that patch)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 19, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2394



--- Comment #3 from yebblies <yebblies@gmail.com> 2011-07-19 14:33:16 EST ---
Or maybe it's bug 4953

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 27, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2394


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-27 00:21:55 PST ---
By fixing issue 5416 (dmd2.057 and later), null literal works as expected in
IFTI.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------