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

23 lines
476 B
Solidity

contract C {
function() internal returns (uint)[20] x;
int256 mutex;
function one() public returns (uint256) {
function() internal returns (uint)[20] memory xmem;
x = xmem;
return 3;
}
function two() public returns (uint256) {
if (mutex > 0) return 7;
mutex = 1;
// If this test fails, it might re-execute this function.
x[0]();
return 2;
}
}
// ----
// one() -> 3
// two() -> FAILURE