solidity/test/libsolidity/semanticTests/array/evm_exceptions_out_of_band_access.sol
2020-03-19 14:42:25 +01:00

20 lines
362 B
Solidity

contract A {
uint256[3] arr;
bool public test = false;
function getElement(uint256 i) public returns (uint256) {
return arr[i];
}
function testIt() public returns (bool) {
uint256 i = this.getElement(5);
test = true;
return true;
}
}
// ----
// test() -> false
// testIt() -> FAILURE
// test() -> false