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

24 lines
321 B
Solidity

contract C {
function() internal storedFn;
bool flag;
constructor() {
if (!flag) {
flag = true;
function() internal invalid;
storedFn = invalid;
storedFn();
}
}
function f() public pure {}
}
contract Test {
function f() public {
new C();
}
}
// ----
// f() -> FAILURE