[Issue 14087] @disable this hides static opCall

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Feb 3 05:32:34 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14087

--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Ali Cehreli from comment #0)
> This seems to be a regression due to the following change:
> 
> https://github.com/D-Programming-Language/dmd/commit/
> 79ae211e71cf0937523010e39f7f0981e9550904
> 
> struct S
> {
>     @disable this();
> 
>     static void opCall()
>     {}
> }
> 
> void main()
> {}
> 
> Error: struct deneme.S static opCall is hidden by constructors and can never
> be called
> 
> It doesn't seem right to me that a disabled constructor hides opCall.

It's intended behavior.

With the expression S(), is it a default construction (but it's @disable-d), or
a call of static opCall()? They conflicts each other.

Therefore compiler raises an error for the struct declaration.

--


More information about the Digitalmars-d-bugs mailing list