www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22093] New: [Reg 2.097] std.typecons.RefCounted!T for struct


          Issue ID: 22093
           Summary: [Reg 2.097] std.typecons.RefCounted!T for struct T
                    without an explicit toString or alias this previously
                    could be converted to string even when uninitialized
                    but now cannot be
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

Below code compiles up through 2.096 but in 2.097 fails with "Attempted to
access an uninitialized payload".

import std.conv : to;
import std.typecons : RefCounted, RefCountedAutoInitialize;

static struct A { int a; }
alias R = RefCounted!(A, RefCountedAutoInitialize.no);
enum e = to!string(R.init);

Jun 29 2021