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

           Summary: Types can't be inferred from template argument types
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: mag...@hetland.org


--- Comment #0 from Magnus Lie Hetland <mag...@hetland.org> 2011-03-28 14:40:38 
PDT ---
The following program fails for me (DMD 2.052):

import std.array, std.container;

template func(T) {
    alias void function(T) func;
}

void G(uint x) {
}

void f(T)(func!T g) { // Won't work, except with (*)
// void f(T)(void function(T) g) {
}

void main() {
    f(&G);
    // f!uint(&G); // (*)
}

With the explicit "void function(T) g" in the argument specification, it works.
Or, if f!uint is specified explicitly. The problem seems to be inferring the
type T "through" the template func().

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

Reply via email to