opCall override default constructor?
Era Scarecrow via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Jun 2 02:53:59 PDT 2016
On Thursday, 2 June 2016 at 08:50:26 UTC, Jacob Carlborg wrote:
> Is it intentional that a non-static opCall overrides the
> default constructor of a struct?
>
> auto f = Foo(3); // line 14
>
> main.d(14): Error: function main.Foo.opCall (string b) is not
> callable using argument types (int)
It sounds like a bug, since the object isn't instantiated yet it
shouldn't be able to call opCall yet...
More information about the Digitalmars-d-learn
mailing list