solidity/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol
2020-07-07 12:16:18 +02:00

20 lines
296 B
Solidity

contract InvalidTest {
function() internal storedFn;
bool flag;
constructor() {
function() internal invalid;
storedFn = invalid;
}
function f() public returns (uint) {
if (flag) return 2;
flag = true;
storedFn();
}
}
// ----
// f() -> FAILURE
// f() -> FAILURE