2020-04-06 15:26:59 +00:00
|
|
|
contract A {
|
|
|
|
uint public a = 42;
|
|
|
|
uint public b;
|
|
|
|
uint public c;
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor(uint x) {
|
2020-04-06 15:26:59 +00:00
|
|
|
b = a;
|
|
|
|
a = x;
|
|
|
|
}
|
|
|
|
function f(uint x) public returns (uint256) { c = x * 3; return 23; }
|
|
|
|
}
|
|
|
|
contract B is A {
|
|
|
|
uint public d = f(a);
|
|
|
|
uint public e = b;
|
|
|
|
uint public b_a;
|
|
|
|
uint public b_b;
|
|
|
|
uint public b_c;
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor() A(17) { b_a = a; b_b = b; b_c = c; }
|
2020-04-06 15:26:59 +00:00
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: true
|
|
|
|
// ----
|
|
|
|
// a() -> 17
|
|
|
|
// b() -> 42
|
|
|
|
// c() -> 51
|
|
|
|
// b_a() -> 17
|
|
|
|
// b_b() -> 42
|
|
|
|
// b_c() -> 51
|
|
|
|
// d() -> 23
|
|
|
|
// e() -> 42
|