Merge pull request #8607 from a3d4/fix-nested-tuples

Fixed nested tuples on the right-hand side.
This commit is contained in:
chriseth
2020-04-08 12:29:52 +02:00
committed by GitHub
7 changed files with 108 additions and 3 deletions
@@ -0,0 +1,17 @@
contract test {
function f3() public returns(int) {
int a = 3;
((, ), ) = ((7, 8), 9);
return a;
}
function f4() public returns(int) {
int a;
(a, ) = (4, (8, 16, 32));
return a;
}
}
// ====
// compileViaYul: false
// ----
// f3() -> 3
// f4() -> 4
@@ -0,0 +1,13 @@
contract C {
function f() public pure returns (uint, uint, uint) {
bytes memory a; bytes memory b; bytes memory c;
(a, (b, c)) = ("0", ("1", "2"));
return (uint8(a[0]), uint8(b[0]), uint8(c[0]));
}
}
// ====
// compileViaYul: also
// ----
// f() -> 0x30, 0x31, 0x32