mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adjust code to review findings
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user