scala> object Test {
| def main(args: Array[String]): Unit = {
| import scala.concurrent._
| import ExecutionContext.Implicits.global
| val source1 = Promise[Int]()
| val source2 = Promise[Int]()
| var done = new java.util.concurrent.atomic.AtomicBoolean(false)
| source2.completeWith(source1.future).future.onComplete {
| case _ => done.set(true)
| }
| source2.tryFailure(new TimeoutException)
| source1.success(123)
| assert(done.get())
| }
| }
defined object Test
scala> (1 to 1000) foreach {i => print("."); Test.main(null)}
.....................................java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:151)
at Test$.main(<console>:19)
at $anonfun$1.apply$mcVI$sp(<console>:9)
at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:166)
... 33 elided
scala> (1 to 1000) foreach {i => print("."); Test.main(null)}
...............java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:151)
at Test$.main(<console>:19)
at $anonfun$1.apply$mcVI$sp(<console>:9)
at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:166)
... 33 elided
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.