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
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
val f = Future { 4 / 0 }
for (exc <- f.failed) println(exc)
val f = Future { 4 / 2 }
val f = Future { 4 / 0 }
for (exc <- f.failed) println(exc)
val f = Future { 4 / 0 }
The last line will evaluate as:
scala> val f = Future { 4 / 0 }
f: scala.concurrent.Future[Int] = List()
which is not possible as an empty list is not a Future.
The text was updated successfully, but these errors were encountered:
Enter the following sequence in the REPL:
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
val f = Future { 4 / 0 }
for (exc <- f.failed) println(exc)
val f = Future { 4 / 2 }
val f = Future { 4 / 0 }
for (exc <- f.failed) println(exc)
val f = Future { 4 / 0 }
The last line will evaluate as:
scala> val f = Future { 4 / 0 }
f: scala.concurrent.Future[Int] = List()
which is not possible as an empty list is not a Future.
The text was updated successfully, but these errors were encountered: