User-defined operators: Tests

This commit is contained in:
wechman
2023-02-22 00:40:03 +01:00
committed by Kamil Śliwak
parent 5b5e853ea0
commit aba5ac5e2a
114 changed files with 3956 additions and 1 deletions
@@ -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