[Issue 13983] RefCounted needs to be @safe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 3 19:36:36 UTC 2023


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

Ate Eskola <Ajieskola at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Ate Eskola <Ajieskola at gmail.com> ---
Solved by https://github.com/dlang/phobos/pull/8368.

Well, mostly.

Caveat 1: It is only `@safe` with the -preview=dip1000 flag. But AFAIK there's
no solution to that. Generic safe reference counting without DIP1000 is simply
impossible.

Caveat 2: To be precise, `RefCounted` is still `@system`. To avoid backward
compatibility problems, you have to use `SafeRefCounted` instead if you want to
be safe.

Feel free to open another issue if you feel these caveats need closing.

--


More information about the Digitalmars-d-bugs mailing list