[Issue 17194] [scope] Fwd reference error with nested struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 6 15:49:53 UTC 2017


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

--- Comment #5 from radu.racariu at gmail.com ---
Just to point that "scope" is to blame here, removing "scope" from the inner
stuct ctor like:

+++++++++++++++++++
struct V
{
    W w;

    struct W
    {
        this(/*scope*/ ref V v)
        {
            this.v = &v;
        }
        V* v;
    }
}

void main()
{
        V v;
}
+++++++++++++++++++

compiles without errors.

--


More information about the Digitalmars-d-bugs mailing list