finally block not executed without catch block
weihsiu opened this issue · 2 comments
weihsiu commented
unless catch block is present, finally block is not executed.
def runFuture(): Unit =
val r = async[Future]:
try
val s = await(Future("hello"))
val i = await(Future(throw new Exception))
s * i
catch
case _: Exception => "caught"
finally
println("done")
println(Await.result(r, Duration.Inf))
if the catch block is commented out, "done" is not printed.
rssh commented
thanks.
rssh commented
Fixed in 0.2.1-RC1 which is published as:
"com.github.rssh" %% "dotty-cps-async" % "0.2.1-RC1"