Converting std.typecons.RefCounted!T to a string gives T's storage location instead of T's fields when T is a struct without an explicit toString. Demonstration: --- void main() { import std.typecons : refCounted; import std.stdio : writeln; writeln(123); // "123" writeln(refCounted(123)); // "123" struct A { string toString() { return "a"; } } writeln(A.init); // "a" writeln(refCounted(A.init)); // "a" // This one doesn't match: struct B { int x; } writeln(B(123)); // "B(123)" writeln(refCounted(B(123))); // "RefCounted!(B, cast(RefCountedAutoInitialize)0)(RefCountedStore(558C7FFBC660))" } ---
@n8sh created dlang/phobos pull request #7352 "Fix Issue 20502: Converting std.typecons.RefCounted!T to a string gives T's storage location instead of T's fields when T is a struct without an explicit toString" fixing this issue: - Fix Issue 20502: Converting std.typecons.RefCounted!T to a string gives T's storage location instead of T's fields when T is a struct without an explicit toString https://github.com/dlang/phobos/pull/7352
dlang/phobos pull request #7352 "Fix Issue 20502: Converting std.typecons.RefCounted!T to a string gives T's storage location instead of T's fields when T is a struct without an explicit toString" was merged into master: - f35bff2c1b503f643a4ff292a4cf74b9d44a5c7e by Nathan Sashihara: Fix Issue 20502: Converting std.typecons.RefCounted!T to a string gives T's storage location instead of T's fields when T is a struct without an explicit toString https://github.com/dlang/phobos/pull/7352