mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove visiblity of libraries in inherited contracts.
This commit is contained in:
committed by
chriseth
parent
9ef050af9a
commit
6b37f1c025
@@ -0,0 +1,17 @@
|
||||
library Lib {
|
||||
function foo(uint256 value) internal returns (uint256) {
|
||||
return value + 42;
|
||||
}
|
||||
}
|
||||
|
||||
contract A {
|
||||
using Lib for uint256;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
function bar(uint256 value) public returns (uint256) {
|
||||
return value.foo(); // Usage of Lib
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9582: (246-255): Member "foo" not found or not visible after argument-dependent lookup in uint256.
|
||||
@@ -0,0 +1,16 @@
|
||||
library Lib {
|
||||
function foo(uint256 value) internal pure returns (uint256) {
|
||||
return value + 42;
|
||||
}
|
||||
}
|
||||
|
||||
contract A {
|
||||
using Lib for uint256;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
using Lib for uint256;
|
||||
function bar(uint256 value) public pure returns (uint256) {
|
||||
return value.foo(); // Usage of Lib
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user