[Issue 16957] access function from inside template with same name
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Dec 7 16:40:02 PST 2016
https://issues.dlang.org/show_bug.cgi?id=16957
--- Comment #1 from John Colvin <john.loughran.colvin at gmail.com> ---
a related problem that seems likely to have the same root cause:
T[N] bar(T, size_t N)(T[N] a)
{
return a;
}
alias foo = bar; // remove this line and everything's ok.
template foo(alias r)
{
enum s = bar(r);
pragma(msg, typeof(s), " ", s);
enum foo = s;
}
enum x = foo!([0,1,2]);
output:
int[3] [0, 1, 2]
test.d(15): Error: cannot infer type from template instance foo!([0, 1, 2])
--
More information about the Digitalmars-d-bugs
mailing list