From d80126b3c542623818f317582e2fe6d060f5d8aa Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Mon, 19 Oct 2020 14:25:06 -0700 Subject: [PATCH] Add regression test for #7960 --- tests/run/i7960.scala | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/run/i7960.scala diff --git a/tests/run/i7960.scala b/tests/run/i7960.scala new file mode 100644 index 000000000000..93cf38d4d2af --- /dev/null +++ b/tests/run/i7960.scala @@ -0,0 +1,31 @@ +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent.duration._ +import scala.concurrent.{Await, Future} + +class A() { + val bc = B.C(50) +} + +object A { + Thread.sleep(100L) + + val a = new A() +} + + +object B { + Thread.sleep(100L) + + case class C(a: Int) + + val a: A = A.a +} + +object Test { + def main(args: Array[String]): Unit = { + Await.result(Future.sequence(Seq( + Future { A.a }, + Future { B.a }, + )), 1.seconds) + } +}