mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Error messages from abi encodecall are giving more details about the types of the involved variables
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
interface I {
|
||||
function f(address payable) external;
|
||||
}
|
||||
|
||||
contract C {
|
||||
function main() external view {
|
||||
abi.encodeCall(I.f, (address(0)));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5407: (136-148): Cannot implicitly convert component at position 0 from "address" to "address payable".
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
interface I {
|
||||
function f(function (string calldata) external) external;
|
||||
}
|
||||
|
||||
contract C {
|
||||
function g(string calldata) external {}
|
||||
|
||||
function main() external view {
|
||||
abi.encodeCall(I.f, (this.g));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5407: (201-209): Cannot implicitly convert component at position 0 from "function (string memory) external" to "function (string calldata) external".
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
interface I {
|
||||
function f(function (string calldata) external view returns (uint)) external;
|
||||
}
|
||||
|
||||
contract C {
|
||||
function g(string memory) external {}
|
||||
|
||||
function main() external view {
|
||||
abi.encodeCall(I.f, (this.g));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5407: (219-227): Cannot implicitly convert component at position 0 from "function (string memory) external" to "function (string calldata) view external returns (uint256)".
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
interface I {
|
||||
function f(string calldata) external;
|
||||
}
|
||||
|
||||
contract C {
|
||||
string s;
|
||||
function main() external view {
|
||||
abi.encodeCall(I.f, (s));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5407: (150-153): Cannot implicitly convert component at position 0 from "string storage ref" to "string calldata".
|
||||
Reference in New Issue
Block a user