Update tests after code review

This commit is contained in:
wechman
2022-09-28 13:07:58 +02:00
parent c61d5b457e
commit c89eecf52b
6 changed files with 54 additions and 6 deletions
@@ -0,0 +1,10 @@
using {add as +} for E;
error E();
function add(E, E) pure returns (E) {
return E.E1;
}
// ----
// TypeError 5172: (21-22): Name has to refer to a user-defined value type, struct, enum or contract.
@@ -1,10 +1,14 @@
using {
shiftL as <<, shiftR as >>,
exp as **, neg as !
shiftL as <<,
shiftR as >>,
exp as **,
neg as !,
f as x
} for int256;
// ----
// ParserError 4403: (22-24): The operator << cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (36-38): The operator >> cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (51-53): The operator ** cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (62-63): The operator ! cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (40-42): The operator >> cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (55-57): The operator ** cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (70-71): The operator ! cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
// ParserError 4403: (82-83): The operator cannot be user-implemented. This is only possible for the following operators: |, &, ^, +, -, *, /, %, ==, !=, <, >, <=, >=, ~
@@ -0,0 +1,11 @@
using {add as +} for S;
struct S {
uint x;
}
function add(S calldata, S calldata) pure returns (S calldata r) {
assembly {
r := 0
}
}
@@ -0,0 +1,18 @@
using {add as +} for S;
struct S {
uint x;
}
function add(S storage a, S storage) pure returns (S storage) {
return a;
}
contract C {
S a;
S b;
function test() public view {
a + b;
}
}