2019-04-24 11:18:13 +00:00
|
|
|
contract BaseBase {
|
|
|
|
uint public x;
|
|
|
|
uint public y;
|
2019-11-05 17:25:34 +00:00
|
|
|
function init(uint a, uint b) public virtual {
|
2019-04-24 11:18:13 +00:00
|
|
|
x = b;
|
|
|
|
y = a;
|
|
|
|
}
|
2019-11-05 17:25:34 +00:00
|
|
|
function init(uint a) public virtual {
|
2019-04-24 11:18:13 +00:00
|
|
|
x = a + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract Base is BaseBase {
|
2019-09-16 12:33:43 +00:00
|
|
|
function init(uint a, uint b) public override {
|
2019-04-24 11:18:13 +00:00
|
|
|
x = a;
|
|
|
|
y = b;
|
|
|
|
}
|
2019-09-16 12:33:43 +00:00
|
|
|
function init(uint a) public override {
|
2019-04-24 11:18:13 +00:00
|
|
|
x = a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract Child is Base {
|
|
|
|
function cInit(uint c) public {
|
|
|
|
Base.init(c);
|
|
|
|
}
|
|
|
|
function cInit(uint c, uint d) public {
|
|
|
|
Base.init(c, d);
|
|
|
|
}
|
|
|
|
function bInit(uint c) public {
|
|
|
|
BaseBase.init(c);
|
|
|
|
}
|
|
|
|
function bInit(uint c, uint d) public {
|
|
|
|
BaseBase.init(c, d);
|
|
|
|
}
|
|
|
|
}
|
2020-04-20 21:21:09 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2019-04-24 11:18:13 +00:00
|
|
|
// ----
|
|
|
|
// x() -> 0
|
|
|
|
// y() -> 0
|
|
|
|
// cInit(uint256): 2 ->
|
|
|
|
// x() -> 2
|
|
|
|
// y() -> 0
|
|
|
|
// cInit(uint256,uint256): 3, 3 ->
|
|
|
|
// x() -> 3
|
|
|
|
// y() -> 3
|
|
|
|
// bInit(uint256): 4 ->
|
|
|
|
// x() -> 5
|
|
|
|
// bInit(uint256,uint256): 9, 10 ->
|
|
|
|
// x() -> 10
|
|
|
|
// y() -> 9
|