Scala 3, Programming Scala.
these topics. boundary and break This mechanism is defined with a new addition to the API, scala.util.boundary$. It provides a cleaner alternative to non-local returns. boundary defines a context for a computation. break returns a value from within the enclosing boundary. Here is an example from