mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8607 from a3d4/fix-nested-tuples
Fixed nested tuples on the right-hand side.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user