We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object Main { val thunkFuture: Future[() => String] = Future.successful(() => throw new RuntimeException("Whoops")) final def shouldTerminate: Future[Unit] = thunkFuture.flatMap { thunk => def fold() = { var done = false while (!done) { println(s"done outside try: $done") try { thunk() } catch { case _: Throwable => println("setting done to true") done = true println(s"done in catch clause: $done") } } } Future { fold() } } def main(args: Array[String]): Unit = { Await.result(shouldTerminate, Duration.Inf) println("done") } }
The program doesn't terminate in 0.21.0-RC1, but terminates correctly in scala 2.12
terminates and produces output:
[info] done outside try: false [info] setting done to true [info] done in catch clause: true [info] done
doesn't terminate and produces output:
[info] done outside try: false [info] setting done to true [info] done in catch clause: true [info] done outside try: false [info] setting done to true [info] done in catch clause: true ... repeated
The text was updated successfully, but these errors were encountered:
639fa95
Merge pull request #7846 from dotty-staging/fix-#7843
21d5b07
Fix #7843: Move LiftTry back to before CapturedVars
No branches or pull requests
minimized code
The program doesn't terminate in 0.21.0-RC1, but terminates correctly in scala 2.12
expectation
terminates and produces output:
actual
doesn't terminate and produces output:
The text was updated successfully, but these errors were encountered: