[Issue 14720] Template function reported as non-template

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 22 19:50:57 PDT 2015


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

--- Comment #6 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Steven Schveighoffer from comment #5)
> Your code compiles for 2.067 (except for foo).
> 
> I also did my own test (which compiles on 2.067 and a recent head version):
> 
[snip]
> 
> Which compiles.
> 
> OP's code does not. I'm unsure of the rules, or how IFTI is supposed to
> work, so I don't want to mark this as rejects-valid, but it sure seems that
> way. Perhaps my code is wrong and should be rejected?

Ah, it's order dependent bug in compiler. Test case:

void bar(T)(auto ref T x) {}
void main() {
    int n;

    bar(1); // or bar(n), bar!int(1), or others
    // if you mask this first instantiation, the next alias will report error.

    alias b = bar!int;
}

--


More information about the Digitalmars-d-bugs mailing list