mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
OverrideChecker treated private functions as inheritable. Hence, a child contract function could not be assigned the function name of a parent contract private function.
18 lines
667 B
Solidity
18 lines
667 B
Solidity
contract A {
|
|
function foo() private pure returns (uint256) { return 1; }
|
|
function foo(uint256 value) private pure returns (uint256) { return 2; }
|
|
function test1() public pure returns (uint256) { return foo(); }
|
|
function test2() public pure returns (uint256) { return foo(0); }
|
|
}
|
|
contract B is A {
|
|
function foo() private pure returns (uint256) { return 3; }
|
|
function foo(uint256 value) private pure returns (uint256) { return 4; }
|
|
function test3() public pure returns (uint256) { return foo(); }
|
|
function test4() public pure returns (uint256) { return foo(0); }
|
|
}
|
|
// ----
|
|
// test1() -> 1
|
|
// test2() -> 2
|
|
// test3() -> 3
|
|
// test4() -> 4
|