[Issue 21561] Unsafe aliasing of immutable union member allowed in @safe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 20 18:15:10 UTC 2021


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

Chloé <chloekek at use.startmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chloekek at use.startmail.com

--- Comment #1 from Chloé <chloekek at use.startmail.com> ---
Note that assigning to the a.x is still prohibited:

---
Error: field `U.x` cannot modify fields in `@safe` code that overlap fields
with other storage classes
---

With that in place, is it necessary to also prohibit accessing the field?

--


More information about the Digitalmars-d-bugs mailing list