www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7366] New: template overload resolution failure

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7366

           Summary: template overload resolution failure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



With DMD 2.058head:

auto foo(T1)(T1 x){}
auto foo(T1,T2)(T1 x,T2 y){}
void main(){foo!(ubyte)(0);}

Error: template tt.foo(T1) does not match any function template declaration
Error: template tt.foo(T1) cannot deduce template function from argument types
!(ubyte)(int)
Error: template instance foo!(ubyte) errors instantiating template

The following works (showing that the first error message is nonsensical):

auto foo(T1)(T1 x){}
void main(){foo!(ubyte)(0);}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 24 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7366


timon.gehr gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|template overload           |IFTI fails to consider
                   |resolution failure          |bounds-checked implicit
                   |                            |conversions for non-deduced
                   |                            |parameter types



Simpler test case:

void foo()(byte k){}
void main(){foo(2);}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7366


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



Looks like a duplicate of regression bug 4953.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 19 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7366


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 4953 ***

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