[Issue 16011] New: [REG2.068] recursive RefCounted used to work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 10 14:56:57 PDT 2016


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

          Issue ID: 16011
           Summary: [REG2.068] recursive RefCounted used to work
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: ag0aep6g at gmail.com

See also this post to D.learn by Lodovico Giaretta:
http://forum.dlang.org/post/mwzkptquptwfpuvtmqoh@forum.dlang.org

----
import std.typecons: RefCounted;

struct S
{
    int x;
    RefCounted!S s;
}

void main()
{
    S s;
    s.x = 1;
    s.s.x = 2;
    s.s.s.x = 3;

    assert(s.x == 1);
    assert(s.s.x == 2);
    assert(s.s.s.x == 3);
}
----

2.067.1: Compiles and passes asserts.
2.068.2, 2.069.2: segfault
2.070.2, 2.071.0: "no size yet for forward reference" errors
git master (bc74f4a): "std/typecons.d(4739): Error: forward reference to
(*this._store)._payload"

Marking this as a phobos regression. I have a reduction, but that works up to
2.069, so there may be something else going on. Filing that separately.

--


More information about the Digitalmars-d-bugs mailing list