mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into breaking
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
interface testInterface {
|
||||
function C(function (string memory) external) external;
|
||||
function D(string calldata) external;
|
||||
function E(string memory) external;
|
||||
function F(address) external;
|
||||
}
|
||||
|
||||
contract testContract {
|
||||
function g(string calldata) external {}
|
||||
function h(string memory) external {}
|
||||
function i(string calldata str) external {
|
||||
this.h(str);
|
||||
this.g(str);
|
||||
}
|
||||
function j(string memory str) external {
|
||||
this.h(str);
|
||||
this.g(str);
|
||||
}
|
||||
function k(string memory str) external pure {
|
||||
abi.encodeCall(testInterface.D, (str));
|
||||
}
|
||||
string s;
|
||||
|
||||
function main() external view {
|
||||
abi.encodeCall(testInterface.C, (this.g));
|
||||
abi.encodeCall(testInterface.C, (this.h));
|
||||
abi.encodeCall(testInterface.D, (s));
|
||||
abi.encodeCall(testInterface.E, (s));
|
||||
abi.encodeCall(testInterface.F, (payable(address(0))));
|
||||
abi.encodeCall(this.i, (s));
|
||||
abi.encodeCall(this.j, (s));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6133: (860-914): Statement has no effect.
|
||||
@@ -0,0 +1,11 @@
|
||||
interface testInterface {
|
||||
function A(address payable) external;
|
||||
}
|
||||
|
||||
contract testContract {
|
||||
function main() external view {
|
||||
abi.encodeCall(testInterface.A, (address(0)));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5407: (171-183): Cannot implicitly convert component at position 0 from "address" to "address payable".
|
||||
@@ -0,0 +1,16 @@
|
||||
interface testInterface {
|
||||
function B(function (string calldata) external) external;
|
||||
}
|
||||
|
||||
contract testContract {
|
||||
function g(string calldata) external {}
|
||||
function h(string memory) external {}
|
||||
|
||||
function main() external view {
|
||||
abi.encodeCall(testInterface.B, (this.g));
|
||||
abi.encodeCall(testInterface.B, (this.h));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5407: (278-286): Cannot implicitly convert component at position 0 from "function (string memory) external" to "function (string calldata) external".
|
||||
// TypeError 5407: (329-337): Cannot implicitly convert component at position 0 from "function (string memory) external" to "function (string calldata) external".
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
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
@@ -1,13 +0,0 @@
|
||||
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
@@ -1,13 +0,0 @@
|
||||
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
@@ -1,12 +0,0 @@
|
||||
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".
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
bytes32[8**90] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError 5462: (25-30): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 1847: (25-30): Array length too large, maximum is 2**256 - 1.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
bytes32[8**90][500] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError 5462: (25-30): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 1847: (25-30): Array length too large, maximum is 2**256 - 1.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
contract C {
|
||||
uint[uint(1)] valid_size_invalid_expr1;
|
||||
uint[uint(2**256-1)] valid_size_invalid_expr2;
|
||||
uint[uint(2**256)] invalid_size_invalid_expr3;
|
||||
|
||||
uint[int(1)] valid_size_invalid_expr4;
|
||||
uint[int(2**256-1)] valid_size_invalid_expr5;
|
||||
uint[int(2**256)] invalid_size_invalid_expr6;
|
||||
}
|
||||
// ----
|
||||
// TypeError 5462: (22-29): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (66-80): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (117-129): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (169-175): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (212-225): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (262-273): Invalid array length, expected integer literal or constant expression.
|
||||
@@ -1,5 +1,8 @@
|
||||
contract C {
|
||||
uint[8**90] ids;
|
||||
uint[2**256-1] okay;
|
||||
uint[2**256] tooLarge;
|
||||
}
|
||||
// ----
|
||||
// TypeError 5462: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 1847: (22-27): Array length too large, maximum is 2**256 - 1.
|
||||
// TypeError 1847: (68-74): Array length too large, maximum is 2**256 - 1.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[8**90][500] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError 5462: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 1847: (22-27): Array length too large, maximum is 2**256 - 1.
|
||||
|
||||
Reference in New Issue
Block a user