Skip to content

Commit a541ae0

Browse files
committed
Corrections
1 parent 6146ff1 commit a541ae0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/_spec/TODOreference/dropped-features/nonlocal-returns.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ A drop-in library replacement is provided in [`scala.util.control.NonLocalReturn
1313

1414
```scala
1515
import scala.util.control.NonLocalReturns.*
16+
1617
extension [T](xs: List[T])
1718
def has(elem: T): Boolean = returning {
1819
for x <- xs do
1920
if x == elem then throwReturn(true)
2021
false
2122
}
23+
2224
@main def test(): Unit =
2325
val xs = List(1, 2, 3, 4, 5)
2426
assert(xs.has(2) == xs.contains(2))

0 commit comments

Comments
 (0)