mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3345 from kevinwucodes/patch-1
add clarity to destructuring assignments with leading comma
This commit is contained in:
commit
a4b886ad3c
@ -295,6 +295,7 @@ Solidity internally allows tuple types, i.e. a list of objects of potentially di
|
|||||||
// the rest of the values are discarded.
|
// the rest of the values are discarded.
|
||||||
(data.length,) = f(); // Sets the length to 7
|
(data.length,) = f(); // Sets the length to 7
|
||||||
// The same can be done on the left side.
|
// The same can be done on the left side.
|
||||||
|
// If the tuple begins in an empty component, the beginning values are discarded.
|
||||||
(,data[3]) = f(); // Sets data[3] to 2
|
(,data[3]) = f(); // Sets data[3] to 2
|
||||||
// Components can only be left out at the left-hand-side of assignments, with
|
// Components can only be left out at the left-hand-side of assignments, with
|
||||||
// one exception:
|
// one exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user