aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-04 22:27:21 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-05-08 22:32:36 +0800
commit741ada79f9fd58a3b652cf42de2a69cad54070b0 (patch)
treeeec29c6f107a4add57e13b79bd933e260c9b2d32
parent8ee5d3b274112d064328aa673496dfb484b03531 (diff)
downloaddexon-solidity-741ada79f9fd58a3b652cf42de2a69cad54070b0.tar.gz
dexon-solidity-741ada79f9fd58a3b652cf42de2a69cad54070b0.tar.zst
dexon-solidity-741ada79f9fd58a3b652cf42de2a69cad54070b0.zip
Update documentation.
-rw-r--r--docs/control-structures.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index f3c351dd..f18e1e10 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -293,12 +293,7 @@ Solidity internally allows tuple types, i.e. a list of objects of potentially di
// 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).
- // If the tuple ends in an empty component,
- // the rest of the values are discarded.
- (data.length,) = f(); // Sets the length to 7
- // 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.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,);
@@ -307,6 +302,11 @@ Solidity internally allows tuple types, i.e. a list of objects of potentially di
}
}
+.. note::
+ Prior to version 0.4.24 it was possible to assign to tuples of smaller size, either
+ filling up on the left or on the right side (which ever was empty). This is
+ now deprecated, both sides have to have the same number of components.
+
Complications for Arrays and Structs
------------------------------------