mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3880 from ethereum/addressMemberDocAndWarn
Improve documentation and warning about accessing contract members in…
This commit is contained in:
commit
d8030c9b2a
@ -18,6 +18,7 @@ Features:
|
|||||||
* Syntax Checker: Issue warning for empty structs (or error as experimental 0.5.0 feature).
|
* Syntax Checker: Issue warning for empty structs (or error as experimental 0.5.0 feature).
|
||||||
* Syntax Checker: Warn about modifiers on functions without implementation (this will turn into an error with version 0.5.0).
|
* Syntax Checker: Warn about modifiers on functions without implementation (this will turn into an error with version 0.5.0).
|
||||||
* Syntax Tests: Add source locations to syntax test expectations.
|
* Syntax Tests: Add source locations to syntax test expectations.
|
||||||
|
* Type Checker: Improve documentation and warnings for accessing contract members inherited from ``address``.
|
||||||
* General: Introduce new constructor syntax using the ``constructor`` keyword as experimental 0.5.0 feature.
|
* General: Introduce new constructor syntax using the ``constructor`` keyword as experimental 0.5.0 feature.
|
||||||
* Inheritance: Error when using empty parentheses for base class constructors that require arguments as experimental 0.5.0 feature.
|
* Inheritance: Error when using empty parentheses for base class constructors that require arguments as experimental 0.5.0 feature.
|
||||||
* Inheritance: Error when using no parentheses in modifier-style constructor calls as experimental 0.5.0 feature.
|
* Inheritance: Error when using no parentheses in modifier-style constructor calls as experimental 0.5.0 feature.
|
||||||
|
@ -179,8 +179,8 @@ All three functions ``call``, ``delegatecall`` and ``callcode`` are very low-lev
|
|||||||
The ``.gas()`` option is available on all three methods, while the ``.value()`` option is not supported for ``delegatecall``.
|
The ``.gas()`` option is available on all three methods, while the ``.value()`` option is not supported for ``delegatecall``.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
All contracts inherit the members of address, so it is possible to query the balance of the
|
All contracts can be converted to ``address`` type, so it is possible to query the balance of the
|
||||||
current contract using ``this.balance``.
|
current contract using ``address(this).balance``.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
The use of ``callcode`` is discouraged and will be removed in the future.
|
The use of ``callcode`` is discouraged and will be removed in the future.
|
||||||
|
@ -1988,7 +1988,8 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
|||||||
m_errorReporter.warning(
|
m_errorReporter.warning(
|
||||||
_memberAccess.location(),
|
_memberAccess.location(),
|
||||||
"Using contract member \"" + memberName +"\" inherited from the address type is deprecated." +
|
"Using contract member \"" + memberName +"\" inherited from the address type is deprecated." +
|
||||||
" Convert the contract to \"address\" type to access the member."
|
" Convert the contract to \"address\" type to access the member,"
|
||||||
|
" for example use \"address(contract)." + memberName + "\" instead."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user