solidity/test/libsolidity/syntaxTests/inheritance/override/implement_private_function_by_public_variable.sol

11 lines
368 B
Solidity
Raw Normal View History

abstract contract X { function test() private virtual returns (uint256); }
contract Y is X {
uint256 public override test = 42;
}
contract T {
constructor() public { new Y(); }
}
2019-10-23 20:10:12 +00:00
// ----
// TypeError: (97-130): Public state variables can only override functions with external visibility.
// TypeError: (22-72): "virtual" and "private" cannot be used together.