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.
17 lines
507 B
Solidity
17 lines
507 B
Solidity
contract A {
|
|
function foo() private pure returns (uint256) { return 1; }
|
|
function bar() internal pure returns (uint256) { return foo(); }
|
|
}
|
|
contract B is A {
|
|
function foo() private pure returns (uint256) { return 2; }
|
|
function test1() public pure returns (uint256) { return bar(); }
|
|
function test2() public pure returns (uint256) { return foo(); }
|
|
}
|
|
contract C is B {
|
|
function foo() public pure returns (uint256) { return 3; }
|
|
}
|
|
// ----
|
|
// test1() -> 1
|
|
// test2() -> 2
|
|
// foo() -> 3
|