scala / 3.1.1 / scala / util / control / nonlocalreturns$.html /

Object scala.util.control.NonLocalReturns

Library implementation of nonlocal return.

Usage:

import scala.util.control.NonLocalReturns._

returning { ... throwReturn(x) ... }

Supertypes
Self type

Classlikes

Source

Concrete methods

Source
def returning[T](op: ReturnThrowable[T] ?=> T): T

Enable nonlocal returns in op.

Source
def throwReturn[T](result: T)(using returner: ReturnThrowable[T]): Nothing

Performs a nonlocal return by throwing an exception.

© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.1.1/scala/util/control/NonLocalReturns$.html