mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4465 from ethereum/tupleAssignment
Disallow tuple assignment with mismatching number of components.
This commit is contained in:
@@ -293,11 +293,6 @@ These can then either be assigned to newly declared variables or to pre-existing
|
||||
(x, y) = (y, x);
|
||||
// Components can be left out (also for variable declarations).
|
||||
(data.length,,) = f(); // Sets the length to 7
|
||||
// Components can only be left out at the left-hand-side of assignments, with
|
||||
// one exception:
|
||||
(x,) = (1,);
|
||||
// (1,) is the only way to specify a 1-component tuple, because (1) is
|
||||
// equivalent to 1.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user