diff options
author | chriseth <chris@ethereum.org> | 2018-04-05 22:19:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-05 22:19:16 +0800 |
commit | d74b71a554395de42ee53ce1d16a03b7cef3fd92 (patch) | |
tree | 2be0f81e063461b689c89009a31955aa2220c743 | |
parent | 4c50ed39d76c4bd96ed73f40077da2c3f6d13c35 (diff) | |
parent | d662622b25ab737887d0c002aec76fc3bbbaf909 (diff) | |
download | dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.tar dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.tar.gz dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.tar.bz2 dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.tar.lz dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.tar.xz dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.tar.zst dexon-solidity-d74b71a554395de42ee53ce1d16a03b7cef3fd92.zip |
Merge pull request #3805 from kevinflo/tuple-documentation-var-removal
Removed documentation reference to var for tuple variable assignment
-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..40070a20 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; + // Tuple values can be assigned to these pre-existing variables + (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). |