diff --git a/docs/types/reference-types.rst b/docs/types/reference-types.rst index a9f44d710..c2b293ba1 100644 --- a/docs/types/reference-types.rst +++ b/docs/types/reference-types.rst @@ -85,8 +85,10 @@ Data locations are not only relevant for persistency of data, but also for the s // The following does not work; it would need to create a new temporary / // unnamed array in storage, but storage is "statically" allocated: // y = memoryArray; - // This does not work either, since it would "reset" the pointer, but there - // is no sensible location it could point to. + // On the other hand: "delete y" is not valid, as assignments to local variables + // referencing storage objects can only be made from existing storage objects. + // It would "reset" the pointer, but there is no sensible location it could point to. + // See "delete" under Operators // delete y; g(x); // calls g, handing over a reference to x h(x); // calls h and creates an independent, temporary copy in memory