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

Ali Cehreli <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Ali Cehreli <[email protected]> ---
Found another example that does not involve a nested struct:

import std.algorithm;

struct Foo(R)
{
    R r;

    this(R r)    // <-- Compilation error
    {}
}

auto foo(R)(R r)
{
    return Foo!R(r);
}

void main()
{
    [1].map!(i => i).foo;
}

Error: field r must be initialized in constructor, because it is nested struct

Ali

--

Reply via email to