mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5197 from ethereum/array-index-tests
More array index tests
This commit is contained in:
commit
81a385ecee
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
bytes32[8**90] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (25-30): Invalid array length, expected integer literal or constant expression.
|
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
bytes32[8**90][500] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (25-30): Invalid array length, expected integer literal or constant expression.
|
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
uint[8**90][500] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
|
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
bytes[32] memory a;
|
||||
a[-1];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (67-69): Type int_const -1 is not implicitly convertible to expected type uint256.
|
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
bytes[32] memory a;
|
||||
a[888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (67-178): Type int_const 8888...(103 digits omitted)...8888 is not implicitly convertible to expected type uint256.
|
Loading…
Reference in New Issue
Block a user