Skip to content

Should the old Breaks be deprecated now there is boundary #23396

Open
@bishabosha

Description

@bishabosha

Compiler version

3.7.1

Minimized example

import scala.util.boundary
import scala.util.control.Breaks.break

def foo(x: Int) = boundary:
  if x < 0 then break()
  else println("positive")

@main def Test = foo(-1)

Output

exception thrown when calling main method

scala.util.control.BreakControl

Expectation

If you wrote this program with an IDE that automatically inserted break, perhaps you wouldn't check why it doesn't work (i.e. perhaps not realising that you imported the old library based solution of Scala 2.13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:boundaryscala.util.boundaryitype:metaIssues about process/similar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions