We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d253610 commit c1a173bCopy full SHA for c1a173b
library/src/scala/util/boundary.scala
@@ -12,7 +12,7 @@ import control.ControlException
12
* The `Break` exception class extends `ControlException` which is a regular
13
* `RuntimeException`, optimized so that stack trace generation is suppressed.
14
* - Better performance: breaks to enclosing scopes in the same method can
15
- * be rwritten to jumps.
+ * be rewritten to jumps.
16
*/
17
object boundary:
18
tests/run/breaks.scala
@@ -11,10 +11,10 @@ object Test {
11
def takeUntil(xs: List[Int], elem: Int) =
boundary:
var buf = new ListBuffer[Int]
- for x <- xs yield
+ for x <- xs do
if x == elem then break(buf.toList)
buf += x
- x
+ xs
19
trait Animal
20
object Dog extends Animal
0 commit comments