Re: UFCS not working with alias

2016-09-08 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 8 September 2016 at 13:38:54 UTC, Steven Schveighoffer wrote: There is a workaround, identified by Vladimir Panteleev (https://blog.thecybershadow.net/2015/04/28/the-amazing-template-that-does-nothing/): import std.algorithm; bool fulfillsKeyPredicate(string s, string t)

Re: UFCS not working with alias

2016-09-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/7/16 4:26 AM, Andre Pany wrote: On Wednesday, 7 September 2016 at 08:08:34 UTC, rikki cattermole wrote: On 07/09/2016 8:06 PM, Andre Pany wrote: Should I open an enhancement request? No. It works outside of the function (part of lookup rules). I simplified my example too much. Yes in

Re: UFCS not working with alias

2016-09-07 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 08:35:26 UTC, rikki cattermole wrote: On 07/09/2016 8:26 PM, Andre Pany wrote: [...] People have tried, this is the behavior as designed. The workaround is simple, don't use UFCS. I won't repeat the explanation or reasoning here, plenty of posts on it ;)

Re: UFCS not working with alias

2016-09-07 Thread rikki cattermole via Digitalmars-d-learn
On 07/09/2016 8:26 PM, Andre Pany wrote: On Wednesday, 7 September 2016 at 08:08:34 UTC, rikki cattermole wrote: On 07/09/2016 8:06 PM, Andre Pany wrote: Should I open an enhancement request? No. It works outside of the function (part of lookup rules). I simplified my example too much.

Re: UFCS not working with alias

2016-09-07 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 08:08:34 UTC, rikki cattermole wrote: On 07/09/2016 8:06 PM, Andre Pany wrote: Should I open an enhancement request? No. It works outside of the function (part of lookup rules). I simplified my example too much. Yes in the example above I can move the

Re: UFCS not working with alias

2016-09-07 Thread rikki cattermole via Digitalmars-d-learn
On 07/09/2016 8:06 PM, Andre Pany wrote: Should I open an enhancement request? No. It works outside of the function (part of lookup rules).

UFCS not working with alias

2016-09-07 Thread Andre Pany via Digitalmars-d-learn
Hi, I just noticed ufcs does not work with alias. Is this limitation needed? void foo(int a) {} void main() { alias bar = foo; 3.foo(); 3.bar(); } Last line fails with "no property 'bar' for type int. Should I open an enhancement request? Kind regards André