solidity/test/libsolidity/semanticTests/intheritance/super_in_constructor.sol
2020-03-19 14:42:25 +01:00

36 lines
554 B
Solidity

contract A {
function f() public virtual returns (uint256 r) {
return 1;
}
}
contract B is A {
function f() public virtual override returns (uint256 r) {
return super.f() | 2;
}
}
contract C is A {
function f() public virtual override returns (uint256 r) {
return super.f() | 4;
}
}
contract D is B, C {
uint256 data;
constructor() public {
data = super.f() | 8;
}
function f() public override (B, C) returns (uint256 r) {
return data;
}
}
// ----
// f() -> 15