File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ fun main() {
111
111
112
112
Note that the use of local returns in the previous three examples is similar to the use of ` continue ` in regular loops.
113
113
114
- There is no direct equivalent for ` break ` , but it can be simulated by adding another nesting lambda and non-locally returning from it:
114
+ There is no direct equivalent for ` break ` , but it can be simulated by adding an outer ` run ` lambda and non-locally
115
+ returning from it:
115
116
116
117
``` kotlin
117
118
// sampleStart
@@ -132,6 +133,8 @@ fun main() {
132
133
```
133
134
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
134
135
136
+ The non-local return here is possible since the nested ` forEach() ` lambda acts as an [ inline function] ( inline-functions.md ) .
137
+
135
138
When returning a value, the parser gives preference to the qualified return:
136
139
137
140
``` kotlin
You can’t perform that action at this time.
0 commit comments