mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
add a test case for decayed tuple expression as left value
This commit is contained in:
parent
568da11369
commit
208429644d
@ -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"(
|
||||
|
@ -1008,6 +1008,7 @@ BOOST_AUTO_TEST_CASE(tuples)
|
||||
var (b,) = (1,);
|
||||
var (c,d) = (1, 2 + a);
|
||||
var (e,) = (1, 2, b);
|
||||
(a) = 3;
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
Loading…
Reference in New Issue
Block a user