Removed documentation reference to the now-depricated var tuple variable assignment syntax

This commit is contained in:
kevinflo 2018-04-02 13:57:19 +09:00
parent be261ed519
commit 884ea39d85

View File

@ -284,10 +284,12 @@ Solidity internally allows tuple types, i.e. a list of objects of potentially di
} }
function g() public { function g() public {
// Declares and assigns the variables. Specifying the type explicitly is not possible. // Variables declared with type
var (x, b, y) = f(); uint x;
// Assigns to a pre-existing variable. bool b;
(x, y) = (2, 7); 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. // Common trick to swap values -- does not work for non-value storage types.
(x, y) = (y, x); (x, y) = (y, x);
// Components can be left out (also for variable declarations). // Components can be left out (also for variable declarations).