solidity/test/libsolidity/semanticTests/functionCall/calling_nonexisting_contract_throws.sol

31 lines
494 B
Solidity
Raw Normal View History

abstract contract D {
function g() public virtual;
}
contract C {
D d = D(0x1212);
function f() public returns (uint256) {
d.g();
return 7;
}
function g() public returns (uint256) {
2020-04-03 14:29:17 +00:00
d.g{gas: 200}();
return 7;
}
function h() public returns (uint256) {
address(d).call(""); // this does not throw (low-level)
return 7;
}
}
2020-05-19 13:12:56 +00:00
// ====
// compileViaYul: also
// ----
// f() -> FAILURE
// g() -> FAILURE
// h() -> 7