solidity/test/libsolidity/semanticTests/uninitializedFunctionPointer/invalidInConstructor.sol

24 lines
320 B
Solidity
Raw Normal View History

contract C {
function() internal storedFn;
bool flag;
2020-06-23 12:14:24 +00:00
constructor() {
if (!flag) {
flag = true;
function() internal invalid;
storedFn = invalid;
invalid();
}
}
function f() public pure {}
}
contract Test {
function f() public {
new C();
}
}
// ----
// f() -> FAILURE