mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Removed documentation reference to the now-depricated var tuple variable assignment syntax
This commit is contained in:
parent
be261ed519
commit
884ea39d85
@ -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).
|
||||
|
Loading…
Reference in New Issue
Block a user