solidity/test/libsolidity/semanticTests/immutable/inheritance.sol
Daniel Kirchner e255c15227 Tests.
2020-03-24 16:45:31 +01:00

31 lines
425 B
Solidity

contract A {
uint8 immutable a;
constructor() public {
a = 4;
}
}
contract B is A {
uint8 immutable b;
constructor() public {
b = 3;
}
}
contract C is A {
uint8 immutable c;
constructor() public {
c = 2;
}
}
contract D is B, C {
uint8 immutable d;
constructor() public {
d = 1;
}
function f() public view returns (uint256, uint256, uint, uint) {
return (a, b, c, d);
}
}
// ----
// f() -> 4, 3, 2, 1