Skip to content

Commit 3658d8a

Browse files
author
Leo
authored
Merge pull request #13292 from The-Arbiter/Function_modifiers_placeholder
Placeholder elaboration in function-modifiers.rst
2 parents 2420966 + e96453d commit 3658d8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/contracts/function-modifiers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ whitespace-separated list and are evaluated in the order presented.
111111
Modifiers cannot implicitly access or change the arguments and return values of functions they modify.
112112
Their values can only be passed to them explicitly at the point of invocation.
113113

114+
In function modifiers, it is necessary to specify when you want the function to which the modifier is
115+
applied to be run. The placeholder statement (denoted by a single underscore character ``_``) is used to
116+
denote where the body of the function being modified should be inserted. Note that the
117+
placeholder operator is different from using underscores as leading or trailing characters in variable
118+
names, which is a stylistic choice.
119+
114120
Explicit returns from a modifier or function body only leave the current
115121
modifier or function body. Return variables are assigned and
116122
control flow continues after the ``_`` in the preceding modifier.

0 commit comments

Comments
 (0)