digitalmars.D.learn - Should ' disable this()' disable 'static opCall()'?
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (16/16) Jan 30 2015 I am thinking about opening a bug with the following code:
- BBaz (14/29) Jan 30 2015 It should only be an error when static opCall() cant be
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (8/21) Jan 30 2015 I agree that this is a problem but return types are not parts of
- BBaz (3/4) Jan 30 2015 Yes, I know this a strange word. But it seems to be a valid one:
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (7/11) Jan 30 2015 Sorry, I did not mean to emphasize "distinguish" over "distinguishable"....
I am thinking about opening a bug with the following code:
struct S
{
disable this();
static void opCall()
{}
}
void main()
{}
Error: struct deneme.S static opCall is hidden by constructors and can
never be called
Which seems to be due to the following change:
https://github.com/D-Programming-Language/dmd/commit/79ae211e71cf0937523010e39f7f0981e9550904
What do you think?
Ali
Jan 30 2015
On Friday, 30 January 2015 at 22:41:35 UTC, Ali Çehreli wrote:
I am thinking about opening a bug with the following code:
struct S
{
disable this();
static void opCall()
{}
}
void main()
{}
Error: struct deneme.S static opCall is hidden by constructors
and can never be called
Which seems to be due to the following change:
https://github.com/D-Programming-Language/dmd/commit/79ae211e71cf0937523010e39f7f0981e9550904
What do you think?
Ali
It should only be an error when static opCall() cant be
distinguishable from this.
---
struct S
{
disable this();
static string opCall(){return "yo mister White";}
}
void main()
{}
---
is distinguishable (by return type) but cant be compiled.
You're right there's a problem.
Jan 30 2015
On 01/30/2015 03:19 PM, BBaz wrote:It should only be an error when static opCall() cant be distinguishable from this. --- struct S { disable this(); static string opCall(){return "yo mister White";} } void main() {} --- is distinguishable (by return type) but cant be compiled.I agree that this is a problem but return types are not parts of function signatures; so return types do not help "distinguish" functions. Besides, constructors don't have return types; so it is a little bit of a stretch to compare them to functions. :)You're right there's a problem.Thank you. Filed: https://issues.dlang.org/show_bug.cgi?id=14087 Ali
Jan 30 2015
"distinguish"Yes, I know this a strange word. But it seems to be a valid one: http://www.collinsdictionary.com/dictionary/english/distinguish?showCookiePolicy=true "distinguishable" is ok as well.
Jan 30 2015
On 01/30/2015 04:30 PM, BBaz wrote:Sorry, I did not mean to emphasize "distinguish" over "distinguishable". I was quoting you as although I understood what you said, I am not used to hearing that word used in function matching. However, "match" does appear in the spec: :) http://dlang.org/function.html#function-overloading Ali"distinguish"Yes, I know this a strange word. But it seems to be a valid one: http://www.collinsdictionary.com/dictionary/english/distinguish?showCookiePolicy=true "distinguishable" is ok as well.
Jan 30 2015








=?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com>