solidity/test/libsolidity/smtCheckerTests/try_catch/try_new.sol
2022-04-01 23:41:18 -05:00

33 lines
922 B
Solidity

contract Reverts {
constructor(uint) { revert("test message."); }
}
contract Succeeds {
constructor(uint) { }
}
contract C {
function f() public returns (Reverts x, string memory txt) {
uint i = 3;
try new Reverts(i) returns (Reverts r) {
x = r;
txt = "success";
} catch Error(string memory s) {
txt = s;
}
}
function g() public returns (Succeeds x, string memory txt) {
uint i = 8;
try new Succeeds(i) returns (Succeeds r) {
x = r;
txt = "success";
} catch Error(string memory s) {
txt = s;
}
}
}
// ====
// SMTEngine: all
// ----
// Warning 4588: (231-245='new Reverts(i)'): Assertion checker does not yet implement this type of function call.
// Warning 4588: (492-507='new Succeeds(i)'): Assertion checker does not yet implement this type of function call.