On Tuesday, 22 December 2020 at 16:32:20 UTC, 9il wrote:
"Struct non-static methods marked with the return attribute ensure the returned reference will not outlive the struct instance."

The issue isn't that the reference outlives the struct. It's that the reference outlives a tag change of the tagged union.

The docs maybe not clear enough. `trustedGet` asserts type is matched, while `get` throws an exception if the type doesn't match.

You can't rely on an assert for @safe (unless it's `assert(false);`).

Reply via email to