mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #13105 from CJ42/docs/address-conversion
docs: add notice about `address` conversion prior to 0.8.0
This commit is contained in:
commit
5de5120497
@ -188,6 +188,10 @@ Addresses
|
||||
As described in :ref:`address_literals`, hex literals of the correct size that pass the checksum
|
||||
test are of ``address`` type. No other literals can be implicitly converted to the ``address`` type.
|
||||
|
||||
Explicit conversions from ``bytes20`` or any integer type to ``address`` result in ``address payable``.
|
||||
Explicit conversions to ``address`` are allowed only from ``bytes20`` and ``uint160``.
|
||||
|
||||
An ``address a`` can be converted to ``address payable`` via ``payable(a)``.
|
||||
An ``address a`` can be converted explicitly to ``address payable`` via ``payable(a)``.
|
||||
|
||||
.. note::
|
||||
Prior to version 0.8.0, it was possible to explicitly convert from any integer type (of any size, signed or unsigned) to ``address`` or ``address payable``.
|
||||
Starting with in 0.8.0 only conversion from ``uint160`` is allowed.
|
Loading…
Reference in New Issue
Block a user