diff options
author | kevinflo <kevinflo@gmail.com> | 2018-04-02 12:57:19 +0800 |
---|---|---|
committer | kevinflo <kevinflo@gmail.com> | 2018-04-02 12:57:19 +0800 |
commit | 884ea39d858c517f82196ecb2cf53bf10f46aa55 (patch) | |
tree | 945d6d40074b61c2d5c1d3986ada3ebc9084b916 | |
parent | be261ed519e472af071f0b70acfbc277a5861a20 (diff) | |
download | dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.gz dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.bz2 dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.lz dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.xz dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.tar.zst dexon-solidity-884ea39d858c517f82196ecb2cf53bf10f46aa55.zip |
Removed documentation reference to the now-depricated var tuple variable assignment syntax
-rw-r--r-- | docs/control-structures.rst | 10 |
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). |