Skip to content

Commit e3d17fc

Browse files
committed
Fix native
1 parent b7681ca commit e3d17fc

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

utest/src-native/utest/PlatformShims.scala

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,15 @@ package utest
22

33
// Taken from the implementation for JS
44

5-
import scala.concurrent.Future
5+
import scala.concurrent.{Await, Future}
6+
import concurrent.duration._
67
import scala.scalanative.reflect.Reflect
78

89
/**
910
* Platform specific stuff that differs between JVM, JS and Native
1011
*/
1112
object PlatformShims {
12-
def await[T](f: Future[T]): T = {
13-
scala.scalanative.runtime.loop()
14-
f.value match {
15-
case Some(v) => v.get
16-
case None => throw new IllegalStateException(
17-
"Test that returns Future must be run asynchronously in Scala Native, see TestTreeSeq::runAsync"
18-
)
19-
}
20-
}
13+
def await[T](f: Future[T]): T = Await.result(f, Duration.Inf)
2114

2215
type EnableReflectiveInstantiation =
2316
scala.scalanative.reflect.annotation.EnableReflectiveInstantiation

0 commit comments

Comments
 (0)