The following code compiles without raising an error regarding `arr.ptr`. void main() @safe { uint[] arr = [1, 2, 3]; bool b = !arr.ptr; }
Checking array.ptr is @safe as long as it isn't dereferenced
There doesn't seem to be a real problem here? `b` would just be set to true if arr.ptr is null, and false otherwise. Accessing the value of a pointer is perfectly fine in @safe. Even deferencing a pointer is fine, since any pointer value constructed in a @safe manner would not point to something invalid. What's not allowed in @safe is *pointer arithmetic*.