Skip to content

Commit da42cf7

Browse files
committed
Drop ControlException
1 parent 63f6e97 commit da42cf7

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

library/src/scala/util/boundary.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
package scala.util
2-
import control.ControlException
32

43
/** A boundary that can be exited by `break` calls.
54
* `boundary` and `break` represent a unified and superior alternative for the
@@ -9,8 +8,8 @@ import control.ControlException
98
* - Unified names: `boundary` to establish a scope, `break` to leave it.
109
* `break` can optionally return a value.
1110
* - Integration with exceptions. `break`s are logically non-fatal exceptions.
12-
* The `Break` exception class extends `ControlException` which is a regular
13-
* `RuntimeException`, optimized so that stack trace generation is suppressed.
11+
* The `Break` exception class extends `RuntimeException` and is optimized so
12+
* that stack trace generation is suppressed.
1413
* - Better performance: breaks to enclosing scopes in the same method can
1514
* be rwritten to jumps.
1615
*/
@@ -19,7 +18,9 @@ object boundary:
1918
/** User code should call `break.apply` instead of throwing this exception
2019
* directly.
2120
*/
22-
class Break[T] private[boundary](val label: Label[T], val value: T) extends ControlException
21+
class Break[T] private[boundary](val label: Label[T], val value: T)
22+
extends RuntimeException(
23+
/*message*/ null, /*cause*/ null, /*enableSuppression=*/ false, /*writableStackTrace*/ false)
2324

2425
/** Labels are targets indicating which boundary will be exited by a `break`.
2526
*/

library/src/scala/util/control/ControlException.scala

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)