NonLocalReturns

scala.util.control.NonLocalReturns$

Library implementation of nonlocal return.

Usage:

import scala.util.control.NonLocalReturns.*

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

Attributes

Source
NonLocalReturns.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

Attributes

Source
NonLocalReturns.scala
Supertypes
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

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

Enable nonlocal returns in op.

Enable nonlocal returns in op.

Attributes

Source
NonLocalReturns.scala
def throwReturn[T](result: T)(using returner: ReturnThrowable[_ >: T]): Nothing

Performs a nonlocal return by throwing an exception.

Performs a nonlocal return by throwing an exception.

Attributes

Source
NonLocalReturns.scala