[Issue 14720] Template function reported as non-template

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 22 15:47:48 PDT 2015


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

--- Comment #1 from Yuxuan Shui <yshuiv7 at gmail.com> ---
I simplified the example a little bit:

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

And one more thing I discovered: If I add a constraint to 'a', say 'if
(isInputRange!S)', then dmd reports 'template instance something.a!string does
not match template declaration a(S)(auto ref S i) if (isInputRange!S)', while
instantiate 'a' directly with 'a!string' works.

--


More information about the Digitalmars-d-bugs mailing list