mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
User-defined operators: Tests
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
type Int is uint8;
|
||||
|
||||
using {add as +} for Int global;
|
||||
|
||||
function add(Int, Int) pure returns (Int) {}
|
||||
|
||||
function f() pure {
|
||||
Int.wrap(0) + Int.wrap(1);
|
||||
}
|
||||
|
||||
function g() view {
|
||||
Int.wrap(0) + Int.wrap(1);
|
||||
}
|
||||
|
||||
function h() {
|
||||
Int.wrap(0) + Int.wrap(1);
|
||||
}
|
||||
// ----
|
||||
// Warning 2018: (154-206): Function state mutability can be restricted to pure
|
||||
// Warning 2018: (208-255): Function state mutability can be restricted to pure
|
||||
Reference in New Issue
Block a user