Forbid private library functions to be attached outside their declaration scope

This commit is contained in:
Matheus Aguiar
2023-01-17 16:27:35 -03:00
parent 229fcc9fce
commit 7779b6f352
5 changed files with 53 additions and 0 deletions
@@ -0,0 +1,10 @@
library L {
using {L.privateFunction} for uint;
function privateFunction(uint x) private pure returns (uint) { return x + 1; }
function f() public pure returns (uint) {
uint x = 1;
return x.privateFunction();
}
}
// ----
// f() -> 2