mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replace casting of external functions to address by a member named "address".
This commit is contained in:
committed by
chriseth
parent
d3ea86b052
commit
9f6fff2120
@@ -1,5 +1,5 @@
|
||||
contract C {
|
||||
function f() public view returns (address) {
|
||||
return address(this.f);
|
||||
return this.f.address;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
function f() public view returns (address payable) {
|
||||
return address(this.f);
|
||||
return this.f.address;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (85-100): Return argument type address is not implicitly convertible to expected type (type of first return variable) address payable.
|
||||
// TypeError: (85-99): Return argument type address is not implicitly convertible to expected type (type of first return variable) address payable.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
struct S { uint a; }
|
||||
function f() public pure returns(address) {
|
||||
S memory s = S(42);
|
||||
return s.address;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (129-138): Member "address" not found or not visible after argument-dependent lookup in struct C.S memory.
|
||||
@@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
struct S { uint address; }
|
||||
}
|
||||
// ----
|
||||
// ParserError: (33-40): Expected identifier but got 'address'
|
||||
Reference in New Issue
Block a user