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
script's location is .\src\main\scala\progscala2\typelessdomore/futures.sc
when i load the script ,its console print 'error: value onSuccess is not a member of scala.concurrent.Future[Int]'
and i use future onComplete { case Success(x) => println(s"success and return is $x") case Failure(t) => println(s"An error has occured: $t" ) }
to replace it,its run sucessful,and i dont know why
i use scala 2.13.1
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out. I don't have automated tests yet for the scripts. I plan to add them while working on the third edition of the book.
The old onSuccess and onFailure methods were deprecated in 2.12 and removed in 2.13. I just pushed a change to the file that uses the onComplete method like you used it.
script's location is .\src\main\scala\progscala2\typelessdomore/futures.sc
when i load the script ,its console print 'error: value onSuccess is not a member of scala.concurrent.Future[Int]'
and i use
future onComplete { case Success(x) => println(s"success and return is $x") case Failure(t) => println(s"An error has occured: $t" ) }
to replace it,its run sucessful,and i dont know why
i use scala 2.13.1
The text was updated successfully, but these errors were encountered: