You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importscala.util.boundaryimportscala.util.control.Breaks.breakdeffoo(x: Int) =boundary:
if x <0then break()
else println("positive")
@main defTest= 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)