mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding more tests for array copying.
Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
This commit is contained in:
co-authored by
Harikrishnan Mulackal
parent
e06af46f3d
commit
c41f996c7b
@@ -0,0 +1,10 @@
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
function f(bytes8[] calldata c) external returns (uint256, bytes10, bytes10, bytes10) {
|
||||
bytes10[] memory m = c;
|
||||
return (m.length, m[0], m[1], m[2]);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9574: (134-156): Type bytes8[] calldata is not implicitly convertible to expected type bytes10[] memory.
|
||||
@@ -0,0 +1,14 @@
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
bytes8[] s;
|
||||
function f() external returns (uint256, bytes10, bytes10, bytes10) {
|
||||
s.push("abcd");
|
||||
s.push("bcde");
|
||||
s.push("cdef");
|
||||
bytes10[] memory m = s;
|
||||
return (m.length, m[0], m[1], m[2]);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9574: (203-225): Type bytes8[] storage ref is not implicitly convertible to expected type bytes10[] memory.
|
||||
Reference in New Issue
Block a user