[Issue 14720] New: Template function reported non-template

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 22 00:56:43 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14720

          Issue ID: 14720
           Summary: Template function reported non-template
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: yshuiv7 at gmail.com

I'm not sure if this is a bug or just really confusing error messages:

This piece of code:

import std.traits;
template ReturnTypeEx(alias A, B) {
    alias ReturnTypeEx = ReturnType!(A!B);
}
template a(R) {
    void a(S)(auto ref S i) { }
}
template b(alias R) {
    void b(S)(S i) {
        alias Ra = ReturnTypeEx!(R, S);
    }
}
void main() {
    alias bb = b!(a!ulong);
    alias bbb =  ReturnTypeEx!(bb, int);
}

Generate error saying the nested template function a.a is not a template
function.

--


More information about the Digitalmars-d-bugs mailing list