Skip to content

Commit 7d865f4

Browse files
authored
annotate opApply() delegates with scope (#3230)
1 parent 6deb338 commit 7d865f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/statement.dd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,10 @@ $(CONSOLE
724724
not escape the scope of the $(I opApply) function (an example would be assigning $(I dg) to a
725725
global). If it cannot be statically guaranteed that $(I dg) does not escape, a closure may
726726
be allocated for it on the heap instead of the stack.
727-
Best practice is to annotate delegate parameters with `scope` when possible.
728727
)
729728

729+
$(BEST_PRACTICE Annotate delegate parameters to `opApply` functions with `scope` when possible.)
730+
730731
$(P $(LEGACY_LNAME2 opApply, op-apply, $(I opApply)) can also be a templated function,
731732
which will infer the types of parameters based on the $(I ForeachStatement).
732733
)

0 commit comments

Comments
 (0)