aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDenton Liu <liu.denton+github@gmail.com>2016-07-04 22:51:02 +0800
committerDenton Liu <liu.denton+github@gmail.com>2016-07-04 22:51:02 +0800
commitcb5fc2301419ea3415a2220775381a70df95ddee (patch)
tree2df1005c1a7a071f560ecad6b749d3d0c8c668d1 /docs
parent0db67b88957c132aeda099d071faee55dbd6b616 (diff)
downloaddexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.tar
dexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.tar.gz
dexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.tar.bz2
dexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.tar.lz
dexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.tar.xz
dexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.tar.zst
dexon-solidity-cb5fc2301419ea3415a2220775381a70df95ddee.zip
Fix incorrect directives
Diffstat (limited to 'docs')
-rw-r--r--docs/control-structures.rst8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index fc55f8e6..96768919 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -146,13 +146,13 @@ Complications for Arrays and Structs
The semantics of assignment are a bit more complicated for non-value types like arrays and structs.
Assigning *to* a state variable always creates an independent copy. On the other hand, assigning to a local variable creates an independent copy only for elementary types, i.e. static types that fit into 32 bytes. If structs or arrays (including ``bytes`` and ``string``) are assigned from a state variable to a local variable, the local variable holds a reference to the original state variable. A second assignment to the local variable does not modify the state but only changes the reference. Assignments to members (or elements) of the local variable *do* change the state.
-.. index:: ! exception, ! throw
+.. index:: ! scoping, declarations, default value
+
+.. _default-value:
Scoping and Declarations
========================
-.. index:: ! scoping, ! declarations, ! default-value
-
In Solidity, a variable which is declared is automatically assigned its default value. It will be assigned on contract
initialization if it is a contract-level variable or at the beginning of a function call if it is a local variable.
This is because the EVM must run deterministically so it would be inappropriate to initialize any variables to random garbage values.
@@ -213,6 +213,8 @@ As a result, the following code is legal, despite being poorly written::
return bar;// returns 5
}
+.. index:: ! exception, ! throw
+
Exceptions
==========