Adding more tests for array copying.

Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
This commit is contained in:
Djordje Mijovic
2020-12-28 13:16:24 +01:00
co-authored by Harikrishnan Mulackal
parent e06af46f3d
commit c41f996c7b
7 changed files with 106 additions and 0 deletions
@@ -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.