Fix abi.encodeCall checks

This commit is contained in:
Duc Thanh Nguyen
2022-07-25 12:40:54 -04:00
parent 800088e38b
commit 5072472917
6 changed files with 63 additions and 12 deletions
@@ -0,0 +1,7 @@
error E(uint);
function f() {
abi.encodeCall(E, (1));
}
// ----
// TypeError 3509: (50-51): Expected regular external function type, or external view on public function. Cannot use errors for abi.encodeCall.
@@ -0,0 +1,9 @@
library L {
event E(uint);
}
function f() {
abi.encodeCall(L.E, (1));
}
// ----
// TypeError 3509: (68-71): Expected regular external function type, or external view on public function. Cannot use events for abi.encodeCall.
@@ -0,0 +1,7 @@
function g(uint) {}
function f() {
abi.encodeCall(g, (1));
}
// ----
// TypeError 3509: (55-56): Expected regular external function type, or external view on public function. Provided internal function.
@@ -0,0 +1,9 @@
library L {
function g() external {}
}
function f() {
abi.encodeCall(L.g, (1));
}
// ----
// TypeError 3509: (78-81): Expected regular external function type, or external view on public function. Cannot use library functions for abi.encodeCall.