remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/remix-analyzer/test/analysis/test-contracts/solidity-v0.5/forLoopIteratesOverDynamicA...

15 lines
441 B

pragma solidity >=0.4.9 <0.6.0;
contract forLoopArr {
uint[] array;
constructor(uint[] memory _array) public {
array = _array;
}
function shiftArrItem(uint index) public returns(uint[] memory) {
// TODO: for (uint i = index; i < array.length-1; i++) should also generate warning
for (uint i = index; i < array.length; i++) {
array[i] = array[i+1];
}
return array;
}
}