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?

struct Foo
{
    int a;

    void opCall(string b) { }
}

void main()
{
    auto f = Foo(3); // line 14
    f("asd");
}

The above code gives the following error:

main.d(14): Error: function main.Foo.opCall (string b) is not callable using argument types (int)

It's this bug:
https://issues.dlang.org/show_bug.cgi?id=9078

Reply via email to