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

26 lines
351 B
Solidity

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