On Saturday, 3 September 2016 at 12:22:25 UTC, thedeemon wrote:
GC (and runtime in general) has no idea what code is safe and
what code is system. GC works with data at run-time. All
@safe-related stuff is about code (not data!) and happens at
compile-time. They are completely orthogonal and independent,
as I understand.
I don't see why you wouldn't be able to use compile-time
information like __traits with the runtime.
In my head, I imagine that at compile-time you can figure out
which unions are in @safe functions, add a UDA to each (so you're
marking data, not code), and then read that information at
run-time (like with __traits).