solidity/test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol

11 lines
419 B
Solidity
Raw Normal View History

2018-03-15 18:54:05 +00:00
contract C {
uint constant a = b * c;
uint constant b = 7;
2018-05-23 13:39:26 +00:00
uint constant c = b + uint(keccak256(abi.encodePacked(d)));
2018-03-15 18:54:05 +00:00
uint constant d = 2 + a;
}
// ----
// TypeError: (17-40): The value of the constant a has a cyclic dependency via c.
2018-05-23 13:39:26 +00:00
// TypeError: (71-129): The value of the constant c has a cyclic dependency via d.
// TypeError: (135-158): The value of the constant d has a cyclic dependency via a.