[Issue 4812] New: Basic template syntax is rejected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 4 12:06:31 PDT 2010


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

           Summary: Basic template syntax is rejected
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rayerd.wiz at gmail.com


--- Comment #0 from Haruki Shigemori <rayerd.wiz at gmail.com> 2010-09-04 12:06:11 PDT ---
import std.stdio;

template foo(T) {
    T foo(T t) {
        return t + 1;
    }
}

void main() {
    writeln(foo(1)); // OK
    writeln(foo!(int)(1)); // OK
    writeln(foo!(int).foo(1)); // NG
}

bug_d.d(12): Error: expected 1 function arguments, not 0
bug_d.d(12): Error: no property 'foo' for type '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