[Issue 4173] New: Explicitly instantiated templates still try to do IFTI in some cases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 10 14:17:04 PDT 2010


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

           Summary: Explicitly instantiated templates still try to do IFTI
                    in some cases
           Product: D
           Version: 2.037
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: schveiguy at yahoo.com


--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-05-10 14:17:02 PDT ---
I'm unsure if this is a minimal case:

interface I(T)
{
    T foo();
}

interface I2(T, U)
{
    T foo();
    U bar();
}

void fn(T)(I!T t1) { }

void fn(T, U)(I2!(T, U) t1) { }

class C : I!int
{
    int foo() { return 5;}
}

void main()
{
    auto c = new C;
    I!int i = c;
    fn!(int)(i); // compiles
    fn!(int)(c); // fails
}

output:

testtemplate.d(26): Error: template testtemplate.fn(T) does not match any
function template declaration
testtemplate.d(26): Error: template testtemplate.fn(T) cannot deduce template
function from argument types !(int)(C)
testtemplate.d(26): Error: template instance errors instantiating template

This compiled with 2.036.

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


More information about the Digitalmars-d-bugs mailing list