Ambiguous template parameter names
jmh530
john.michael.hall at gmail.com
Wed May 2 20:32:43 UTC 2018
In the function below, there is a template parameter and a normal
parameter both with the same name. However, the function returns
the normal parameter. The template parameter is effectively
ignored. I was surprised by this behavior.
Is this a bug or intentional? I did not see it documented
anywhere.
```
int foo(int val)(int val)
{
return val;
}
void main()
{
assert(foo!1(2) == 2);
}
```
More information about the Digitalmars-d-learn
mailing list