solidity/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol
2021-08-16 22:24:06 +02:00

31 lines
536 B
Solidity

contract C {
function balance() public returns (uint256) {
return 1;
}
function transfer(uint256 amount) public returns (uint256) {
return amount;
}
}
contract D {
function f() public returns (uint256) {
return (new C()).balance();
}
function g() public returns (uint256) {
return (new C()).transfer(5);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 1
// gas irOptimized: 78722
// gas legacy: 115012
// g() -> 5
// gas irOptimized: 78811
// gas legacy: 115558