From 208429644dbf646e90107447b148e7edb6c36512 Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Mon, 4 Jan 2016 16:11:13 +0800 Subject: add a test case for decayed tuple expression as left value --- test/libsolidity/SolidityEndToEndTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/libsolidity/SolidityEndToEndTest.cpp') diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index d57360dc..2f627fc2 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -5785,6 +5785,21 @@ BOOST_AUTO_TEST_CASE(string_tuples) BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(0x40), u256(0x80), u256(3), string("abc"), u256(3), string("def"))); } +BOOST_AUTO_TEST_CASE(decayed_tuple) +{ + char const* sourceCode = R"( + contract C { + function f() returns (uint) { + uint x = 1; + (x) = 2; + return x; + } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(2))); +} + BOOST_AUTO_TEST_CASE(destructuring_assignment) { char const* sourceCode = R"( -- cgit