Skip to content

Commit c0e6780

Browse files
author
Leo
authored
Merge pull request #12855 from aathan/patch-12
Rephrase named vs unnamed parameters in function definitions (in control-structures.rst).
2 parents fbef272 + 0561bd6 commit c0e6780

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/control-structures.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ throws an exception or goes out of gas.
150150
use ``f.value(x).gas(g)()``. This was deprecated in Solidity 0.6.2 and is no
151151
longer possible since Solidity 0.7.0.
152152

153-
Named Calls and Anonymous Function Parameters
154-
---------------------------------------------
153+
Function Calls with Named Parameters
154+
------------------------------------
155155

156156
Function call arguments can be given by name, in any order,
157157
if they are enclosed in ``{ }`` as can be seen in the following
@@ -176,11 +176,13 @@ parameters from the function declaration, but can be in arbitrary order.
176176
177177
}
178178
179-
Omitted Function Parameter Names
180-
--------------------------------
179+
Omitted Names in Function Definitions
180+
-------------------------------------
181181

182-
The names of unused parameters (especially return parameters) can be omitted.
183-
Those parameters will still be present on the stack, but they are inaccessible.
182+
The names of parameters and return values in the function declaration can be omitted.
183+
Those items with omitted names will still be present on the stack, but they are
184+
inaccessible by name. An omitted return value name
185+
can still return a value to the caller by use of the ``return`` statement.
184186

185187
.. code-block:: solidity
186188

0 commit comments

Comments
 (0)