mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
fixup! User-defined operators: Tests
This commit is contained in:
parent
1edb74dbc9
commit
cd83d09cf3
@ -0,0 +1,9 @@
|
||||
type Int is int128;
|
||||
|
||||
library L {
|
||||
function privateOperator(Int, Int) private pure returns (Int) {}
|
||||
}
|
||||
|
||||
using {L.privateOperator as +} for Int;
|
||||
// ----
|
||||
// TypeError 6772: (112-129): Function "L.privateOperator" is private and therefore cannot be attached to a type outside of the library where it is defined.
|
@ -3,11 +3,7 @@ type Int is int128;
|
||||
library L {
|
||||
function publicOperator(Int, Int) public pure returns (Int) {}
|
||||
function internalOperator(Int, Int) internal pure returns (Int) {}
|
||||
function privateOperator(Int, Int) private pure returns (Int) {}
|
||||
}
|
||||
|
||||
using {L.publicOperator as +} for Int;
|
||||
using {L.internalOperator as +} for Int;
|
||||
// FIXME: Being able to use private library functions in a file-level 'using for' is a bug.
|
||||
// See: https://github.com/ethereum/solidity/issues/13764
|
||||
using {L.privateOperator as +} for Int;
|
||||
|
Loading…
Reference in New Issue
Block a user