Fix tuple assignments for empty tuples in Yul IR.

This commit is contained in:
Daniel Kirchner
2020-04-15 11:10:52 +02:00
parent cbd90f8d12
commit 0c5c93f3c2
4 changed files with 23 additions and 24 deletions
@@ -15,6 +15,16 @@ contract test {
(((, a),)) = ((1, 2), 3);
return a;
}
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: also
@@ -22,3 +32,5 @@ contract test {
// f0() -> 2, true
// f1() -> 1
// f2() -> 2
// f3() -> 3
// f4() -> 4
@@ -1,17 +0,0 @@
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