[Issue 9707] New: Template argument deduction does not work with static methods of shared class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 12 12:04:39 PDT 2013


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

           Summary: Template argument deduction does not work with static
                    methods of shared class
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: weltensturm at gmail.com


--- Comment #0 from Robert Luger <weltensturm at gmail.com> 2013-03-12 12:04:37 PDT ---
When passing arguments to a static shared template method, DMD is unable to
deduce types. Code:

import std.stdio;
shared class test {
    static void sharedTemplate(T)(T arg){
        writeln(arg);
    }
}
void main(){
    test.sharedTemplate(5);
}

Produces:

src\main.d(10): Error: template main.test.sharedTemplate does not match any
function template declaration. Candidates are:
src\main.d(4):        main.test.sharedTemplate(T)(T arg)
src\main.d(10): Error: template main.test.sharedTemplate(T)(T arg) cannot
deduce template function from argument types !()(int)

-- 
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