solidity/test/libsolidity/semanticTests/intheritance/address_overload_resolution.sol
2020-03-19 14:42:25 +01:00

25 lines
409 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);
}
}
// ----
// f() -> 1
// g() -> 5