Merge pull request #10530 from ethereum/changeConstructorOrder

[Sol->Yul] Evaluate base arguments in derived to base order.
This commit is contained in:
chriseth
2020-12-08 20:32:48 +01:00
committed by GitHub
2 changed files with 44 additions and 5 deletions
@@ -0,0 +1,24 @@
contract A {
constructor(uint) {}
}
contract B {
constructor(uint) {}
}
contract C {
constructor(uint) {}
}
contract D {
constructor(uint) {}
}
contract X is D, C, B, A {
uint[] x;
function f(uint _x) internal returns (uint) {
x.push(_x);
}
function g() public view returns (uint[] memory) { return x; }
constructor() A(f(1)) C(f(2)) B(f(3)) D(f(4)) {}
}
// ====
// compileViaYul: also
// ----
// g() -> 0x20, 4, 1, 3, 2, 4