aboutsummaryrefslogtreecommitdiffstats
path: root/docs/control-structures.rst
diff options
context:
space:
mode:
authorkevinflo <kevinflo@gmail.com>2018-04-02 12:57:19 +0800
committerkevinflo <kevinflo@gmail.com>2018-04-02 12:57:19 +0800
commit884ea39d858c517f82196ecb2cf53bf10f46aa55 (patch)
tree945d6d40074b61c2d5c1d3986ada3ebc9084b916 /docs/control-structures.rst
parentbe261ed519e472af071f0b70acfbc277a5861a20 (diff)
downloaddexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.gz
dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.zst
dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.zip
Removed documentation reference to the now-depricated var tuple variable assignment syntax
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r--docs/control-structures.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 46e076e5..cdc2d20d 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -284,10 +284,12 @@ Solidity internally allows tuple types, i.e. a list of objects of potentially di
}
function g() public {
- // Declares and assigns the variables. Specifying the type explicitly is not possible.
- var (x, b, y) = f();
- // Assigns to a pre-existing variable.
- (x, y) = (2, 7);
+ // Variables declared with type
+ uint x;
+ bool b;
+ uint y;
+ // These pre-existing variables can then be assigned to the tuple values
+ (x, b, y) = f();
// Common trick to swap values -- does not work for non-value storage types.
(x, y) = (y, x);
// Components can be left out (also for variable declarations).