Adjust code to review findings

This commit is contained in:
wechman
2022-09-28 13:06:25 +02:00
parent a8bf1f255d
commit c1dc8df9c9
9 changed files with 31 additions and 17 deletions
@@ -10,4 +10,4 @@ function add(E, E) pure returns (E) {
}
// ----
// TypeError 9921: (0-23): The "using" directive cannot be used to attach functions to the enum type.
// TypeError 9921: (0-23): The "using" directive cannot be used to attach functions to enum types.
@@ -0,0 +1,14 @@
struct S { uint v; }
using {add as +} for S;
function add(S memory _a, S memory) pure returns (S memory) {
return _a;
}
function g() pure returns (S memory) {
S memory a = S(0);
S memory b = S(1);
S memory c = S(2);
return a + b + c;
}
@@ -14,4 +14,4 @@ function test() {
Int.wrap(0) + Int.wrap(1);
}
// ----
// TypeError 2271: (213-238): Operator + not compatible with types Int and Int. A user-defined operator not unique.
// TypeError 2271: (213-238): Operator + not compatible with types Int and Int. Multiple user-defined functions provided for this operator.