aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-07-11 20:47:37 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-07-12 18:54:42 +0800
commitdf8bbffd8e5b16d29f71860e1c3c851dd65693c4 (patch)
treefd9ea8f9189cf42289859bea771647f7a57ae752
parentaa81ac44562f05e119e60d723ee4ce293fc9a8c0 (diff)
downloaddexon-solidity-df8bbffd8e5b16d29f71860e1c3c851dd65693c4.tar.gz
dexon-solidity-df8bbffd8e5b16d29f71860e1c3c851dd65693c4.tar.zst
dexon-solidity-df8bbffd8e5b16d29f71860e1c3c851dd65693c4.zip
Update docs.
-rw-r--r--docs/frequently-asked-questions.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index e64849ea..17e71747 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -273,9 +273,11 @@ of variable it concerns:
* state variables are always in storage
* function arguments are in memory by default
-* local variables of struct, array or mapping type reference storage by default
+* local variables of mapping type reference storage by default
* local variables of value type (i.e. neither array, nor struct nor mapping) are stored in the stack
+For local variables of struct or array type the storage location has to be stated explicitly.
+
Example::
pragma solidity ^0.4.0;
@@ -309,8 +311,9 @@ carry back to ``data1`` or ``data2``.
.. warning::
Prior to version 0.5.0, a common mistake was to declare a local variable and assume that it will
be created in memory, although it will be created in storage. Using such a variable without initializing
- it could lead to unexpected behavior. Starting from 0.5.0, however, storage variables have to be initialized,
- which should prevent these kinds of mistakes.
+ could lead to unexpected behavior. Starting from 0.5.0, however, the storage location for local variables
+ has to be specified explicitly and local storage variables have to be initialized, which should prevent
+ these kinds of mistakes.
******************
Advanced Questions