mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9088 from ethereum/fixReturnDOc
Fix documentation about return values.
This commit is contained in:
commit
17e2040997
@ -76,7 +76,7 @@ are initialized with their :ref:`default value <default-value>` and have that
|
|||||||
value until they are (re-)assigned.
|
value until they are (re-)assigned.
|
||||||
|
|
||||||
You can either explicitly assign to return variables and
|
You can either explicitly assign to return variables and
|
||||||
then leave the function using ``return;``,
|
then leave the function as above,
|
||||||
or you can provide return values
|
or you can provide return values
|
||||||
(either a single or :ref:`multiple ones<multi-return>`) directly with the ``return``
|
(either a single or :ref:`multiple ones<multi-return>`) directly with the ``return``
|
||||||
statement::
|
statement::
|
||||||
@ -94,8 +94,8 @@ statement::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
This form is equivalent to first assigning values to the
|
If you use an early ``return`` to leave a function that has return variables,
|
||||||
return variables and then using ``return;`` to leave the function.
|
you must provide return values together with the return statement.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
You cannot return some types from non-internal functions, notably
|
You cannot return some types from non-internal functions, notably
|
||||||
|
Loading…
Reference in New Issue
Block a user