On Fri, Sep 26, 2014 at 07:32:49PM -0400, Steven Schveighoffer via 
Digitalmars-d wrote:
> On 9/26/14 6:32 PM, H. S. Teoh via Digitalmars-d wrote:
> 
> >Does the compiler infer it as @safe, though?
> 
> Hm... good point, I'm not sure if unions are considered @safe. But I
> think that would be a decent enhancement request if not.
[...]

        union U {
                int* ptr;
                long i;
        }

        void main() @safe {
                U u;
                u.i = 12345;
                *u.ptr = 54321; // this can't possibly be @safe
        }

How would the compiler decide which union operations are @safe and which
are not?


T

-- 
He who laughs last thinks slowest.

Reply via email to