Merge pull request #8924 from ethereum/arraySliceBug

Fix array slice bug.
This commit is contained in:
chriseth
2020-05-13 16:06:28 +02:00
committed by GitHub
9 changed files with 53 additions and 6 deletions
@@ -2,9 +2,8 @@ pragma experimental ABIEncoderV2;
contract C {
function f(uint256[][] calldata x) external pure {
x[0][1:2];
x[1:2][1:2];
uint256 a = x[1:2][1:2][1:][3:][0][2];
uint256 b = x[1:][3:4][1][1:][2:3][0];
uint256 a = x[0][1:2][1:2][1:][3:][0];
uint256 b = x[1][1:][3:4][1:][2:3][0];
a; b;
}
}
@@ -0,0 +1,14 @@
pragma experimental ABIEncoderV2;
contract C {
function f(uint256[][] calldata x) external pure {
x[1:2];
x[:];
x[1:];
x[:2];
}
}
// ----
// TypeError: (110-116): Index range access is not supported for arrays with dynamically encoded base types.
// TypeError: (126-130): Index range access is not supported for arrays with dynamically encoded base types.
// TypeError: (140-145): Index range access is not supported for arrays with dynamically encoded base types.
// TypeError: (155-160): Index range access is not supported for arrays with dynamically encoded base types.