Skip to content

Commit 5cf3973

Browse files
author
Leo
authored
Merge pull request #12852 from aathan/patch-9
Update reference-types.rst
2 parents 9dd2e0e + 898ad25 commit 5cf3973

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/types/reference-types.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ Data locations are not only relevant for persistency of data, but also for the s
8585
// The following does not work; it would need to create a new temporary /
8686
// unnamed array in storage, but storage is "statically" allocated:
8787
// y = memoryArray;
88-
// This does not work either, since it would "reset" the pointer, but there
89-
// is no sensible location it could point to.
88+
// Similarly, "delete y" is not valid, as assignments to local variables
89+
// referencing storage objects can only be made from existing storage objects.
90+
// It would "reset" the pointer, but there is no sensible location it could point to.
91+
// For more details see the documentation of the "delete" operator.
9092
// delete y;
9193
g(x); // calls g, handing over a reference to x
9294
h(x); // calls h and creates an independent, temporary copy in memory

0 commit comments

Comments
 (0)