Re: Ambiguous template parameter names

2018-05-04 Thread jmh530 via Digitalmars-d-learn
On Thursday, 3 May 2018 at 13:30:03 UTC, bauss wrote: On Thursday, 3 May 2018 at 02:51:18 UTC, Meta wrote: If you want that, you might be able to do `int val = val` on the inner function, though I'm not sure that'll work. It does not work and will do nothing. Below compiles, but my guess i

Re: Ambiguous template parameter names

2018-05-03 Thread bauss via Digitalmars-d-learn
On Thursday, 3 May 2018 at 02:51:18 UTC, Meta wrote: If you want that, you might be able to do `int val = val` on the inner function, though I'm not sure that'll work. It does not work and will do nothing.

Re: Ambiguous template parameter names

2018-05-02 Thread Meta via Digitalmars-d-learn
On Thursday, 3 May 2018 at 02:48:10 UTC, jmh530 wrote: On Thursday, 3 May 2018 at 00:52:58 UTC, Meta wrote: [snip] It's not a big per se. It's a consequence of the declaration expanding to the real template function form (I can't type it all out as I'm on my phone), thus the inner `val` from

Re: Ambiguous template parameter names

2018-05-02 Thread jmh530 via Digitalmars-d-learn
On Thursday, 3 May 2018 at 00:52:58 UTC, Meta wrote: [snip] It's not a big per se. It's a consequence of the declaration expanding to the real template function form (I can't type it all out as I'm on my phone), thus the inner `val` from the function shadows the one from the template. That

Re: Ambiguous template parameter names

2018-05-02 Thread Meta via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 20:32:43 UTC, jmh530 wrote: 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

Re: Ambiguous template parameter names

2018-05-02 Thread user1234 via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 20:32:43 UTC, jmh530 wrote: 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

Ambiguous template parameter names

2018-05-02 Thread jmh530 via Digitalmars-d-learn
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 a