From 276229cc58e00dabeb1c7d800e91131816969a02 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 6 Mar 2017 14:49:51 +0100 Subject: Tests for no compound assignment for tuples. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/libsolidity') 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"( -- cgit