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 {
// 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).