Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.util/scala.util.control/NonLocalReturns

NonLocalReturns

scala.util.control.NonLocalReturns

Library implementation of nonlocal return.

Usage:

import scala.util.control.NonLocalReturns.*

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

This API has been deprecated. Its functionality is better served by

  • scala.util.boundary in place ofreturning
  • scala.util.break in place ofthrowReturn

The new abstractions work with plainRuntimeExceptions and are more performant, since returns within the scope of the same method can be rewritten by the compiler to jumps.

Attributes

Deprecated
[Since version 3.3]Use scala.util.boundary instead
Source
NonLocalReturns.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type

Members list

Type members

Deprecated classlikes

Attributes

Deprecated
[Since version 3.3]Use scala.util.boundary.Break instead
Source
NonLocalReturns.scala
Supertypes
classThrowable
classObject
traitMatchable
classAny
Show all

Value members

Deprecated methods

defreturning[T](op:ReturnThrowable[T]?=>T):T

Enable nonlocal returns inop.

Enable nonlocal returns inop.

Attributes

Deprecated
[Since version 3.3]Use scala.util.boundary instead
Source
NonLocalReturns.scala
defthrowReturn[T](result:T)(usingreturner:ReturnThrowable[_ >:T]):Nothing

Performs a nonlocal return by throwing an exception.

Performs a nonlocal return by throwing an exception.

Attributes

Deprecated
[Since version 3.3]Use scala.util.boundary.break instead
Source
NonLocalReturns.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp