mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding syntax tests for bytes.concat.
This commit is contained in:
parent
840df80dac
commit
e7da9f3d52
@ -0,0 +1,7 @@
|
|||||||
|
contract C {
|
||||||
|
function g() public pure returns (bytes memory) {
|
||||||
|
return bytes.concat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 6359: (82-94): Return argument type function () pure returns (bytes memory) is not implicitly convertible to expected type (type of first return variable) bytes memory.
|
@ -0,0 +1,8 @@
|
|||||||
|
contract C {
|
||||||
|
function f() public {
|
||||||
|
bytes memory a;
|
||||||
|
bytes memory b = type(bytes).concat(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 4259: (93-98): Invalid type for argument in the function call. A contract type or an integer type is required, but type(bytes) provided.
|
@ -0,0 +1,8 @@
|
|||||||
|
contract C {
|
||||||
|
function f() public {
|
||||||
|
bytes memory a;
|
||||||
|
bytes memory b = a.concat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 9582: (88-96): Member "concat" not found or not visible after argument-dependent lookup in bytes memory.
|
@ -0,0 +1,14 @@
|
|||||||
|
contract C {
|
||||||
|
bytes s;
|
||||||
|
function f(bytes calldata c, string calldata c1) public {
|
||||||
|
bytes memory a;
|
||||||
|
bytes16 b;
|
||||||
|
uint8[] memory num;
|
||||||
|
bytes1[] memory m;
|
||||||
|
bytes memory d = bytes.concat(a, b, c, num, s, "abc", m, c1, bytes(c1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 8015: (233-236): Invalid type for argument in the bytes.concat function call. bytes or fixed bytes type is required, but uint8[] provided.
|
||||||
|
// TypeError 8015: (248-249): Invalid type for argument in the bytes.concat function call. bytes or fixed bytes type is required, but bytes1[] provided.
|
||||||
|
// TypeError 8015: (251-253): Invalid type for argument in the bytes.concat function call. bytes or fixed bytes type is required, but string provided.
|
Loading…
Reference in New Issue
Block a user