aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-03-08 23:10:40 +0800
committerGitHub <noreply@github.com>2017-03-08 23:10:40 +0800
commit69a06fe1633c3e5204e6ae4276dd985eae29acfe (patch)
tree6aea223a9be80c9e26c8692d5ae4dfbb58d030eb /test/libsolidity
parent78f7dd23446fb0bd4bff1847d560df4fac0e1159 (diff)
parentc7d61a2c6afb88787174bbb6a7bce934deefef70 (diff)
downloaddexon-solidity-69a06fe1633c3e5204e6ae4276dd985eae29acfe.tar.gz
dexon-solidity-69a06fe1633c3e5204e6ae4276dd985eae29acfe.tar.zst
dexon-solidity-69a06fe1633c3e5204e6ae4276dd985eae29acfe.zip
Merge pull request #1749 from ethereum/compoundForTuples
Disallow compound assignment for tuples.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 3d82fc70..da3e81ed 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2992,6 +2992,18 @@ BOOST_AUTO_TEST_CASE(tuple_assignment_from_void_function)
CHECK_ERROR(text, TypeError, "Cannot declare variable with void (empty tuple) type.");
}
+BOOST_AUTO_TEST_CASE(tuple_compound_assignment)
+{
+ char const* text = R"(
+ contract C {
+ function f() returns (uint a, uint b) {
+ (a, b) += (1, 1);
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Compound assignment is not allowed for tuple types.");
+}
+
BOOST_AUTO_TEST_CASE(member_access_parser_ambiguity)
{
char const* text = R"(