Re: Aliasing multiple delegates to the same name - very strange behaviour

2018-02-25 Thread Meta via Digitalmars-d
On Sunday, 25 February 2018 at 08:07:03 UTC, user1234 wrote: On Sunday, 25 February 2018 at 05:16:21 UTC, Meta wrote: On Sunday, 25 February 2018 at 04:59:58 UTC, Basile B. wrote: Use templates to prevent implicit conversion: alias f(T = int) = (T n) => 0; alias f(T = char) = (T n) => 'a';

Re: Aliasing multiple delegates to the same name - very strange behaviour

2018-02-25 Thread user1234 via Digitalmars-d
On Sunday, 25 February 2018 at 05:16:21 UTC, Meta wrote: On Sunday, 25 February 2018 at 04:59:58 UTC, Basile B. wrote: Use templates to prevent implicit conversion: alias f(T = int) = (T n) => 0; alias f(T = char) = (T n) => 'a'; alias f(T = bool) = (T n) => false; Bug report is invalid and

Re: Aliasing multiple delegates to the same name - very strange behaviour

2018-02-24 Thread Meta via Digitalmars-d
On Sunday, 25 February 2018 at 04:59:58 UTC, Basile B. wrote: Use templates to prevent implicit conversion: alias f(T = int) = (T n) => 0; alias f(T = char) = (T n) => 'a'; alias f(T = bool) = (T n) => false; Bug report is invalid and can be closed. Please don't be so hasty. The main focus

Re: Aliasing multiple delegates to the same name - very strange behaviour

2018-02-24 Thread Meta via Digitalmars-d
On Sunday, 25 February 2018 at 04:47:47 UTC, Nicholas Wilson wrote: On Sunday, 25 February 2018 at 04:06:43 UTC, Meta wrote: I just filed this bug: https://issues.dlang.org/show_bug.cgi?id=18520 Not only does the following code compile and link successfully, it prints 0 three times when ran:

Re: Aliasing multiple delegates to the same name - very strange behaviour

2018-02-24 Thread Basile B. via Digitalmars-d
On Sunday, 25 February 2018 at 04:06:43 UTC, Meta wrote: I just filed this bug: https://issues.dlang.org/show_bug.cgi?id=18520 Not only does the following code compile and link successfully, it prints 0 three times when ran: alias f = (int n) => 0; alias f = (char c) => 'a'; alias f = (bool

Re: Aliasing multiple delegates to the same name - very strange behaviour

2018-02-24 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 25 February 2018 at 04:06:43 UTC, Meta wrote: I just filed this bug: https://issues.dlang.org/show_bug.cgi?id=18520 Not only does the following code compile and link successfully, it prints 0 three times when ran: alias f = (int n) => 0; alias f = (char c) => 'a'; alias f = (bool

Aliasing multiple delegates to the same name - very strange behaviour

2018-02-24 Thread Meta via Digitalmars-d
I just filed this bug: https://issues.dlang.org/show_bug.cgi?id=18520 Not only does the following code compile and link successfully, it prints 0 three times when ran: alias f = (int n) => 0; alias f = (char c) => 'a'; alias f = (bool b) => false; void main() { import std.stdio;