Remove visiblity of libraries in inherited contracts.

This commit is contained in:
Mathias Baumann
2020-07-09 16:38:29 +02:00
committed by chriseth
parent 9ef050af9a
commit 6b37f1c025
6 changed files with 40 additions and 8 deletions
@@ -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
}
}