solidity/test/libsolidity/semanticTests/uninitializedFunctionPointer/invalidStoredInConstructor.sol
2020-11-24 19:54:18 +01:00

26 lines
352 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();
}
}
// ====
// compileViaYul: also
// ----
// f() -> FAILURE