Skip to content

Commit 25efae1

Browse files
committed
Fix compilation failures
1 parent a81febc commit 25efae1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

tests/pos/suspend-strawman-2/Async.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object Async:
2727
/** A toplevel async group with given scheduler and a synthetic root that
2828
* ignores cancellation requests
2929
*/
30-
given fromScheduler(using s: Scheduler): AsyncConfig with
30+
given fromScheduler(using s: Scheduler): Config with
3131
def root = Cancellable.empty
3232
def scheduler = s
3333

tests/pos/suspend-strawman-2/futures.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ object Future:
130130
* If the future is created in an Async context, it is added to the
131131
* children of that context's root.
132132
*/
133-
def apply[T](body: Async ?=> T)(using ac: AsyncConfig): Future[T] =
133+
def apply[T](body: Async ?=> T)(using ac: Async.Config): Future[T] =
134134
val f = RunnableFuture(body)(using ac.scheduler)
135135
ac.root.addChild(f)
136136
f
@@ -141,7 +141,7 @@ object Future:
141141
* If both futures succeed, succeed with their values in a pair. Otherwise,
142142
* fail with the failure that was returned first and cancel the other.
143143
*/
144-
def zip[T2](f2: Future[T2])(using AsyncConfig): Future[(T1, T2)] = Future:
144+
def zip[T2](f2: Future[T2])(using Async.Config): Future[(T1, T2)] = Future:
145145
Async.await(Async.either(f1, f2)) match
146146
case Left(Success(x1)) => (x1, f2.value)
147147
case Right(Success(x2)) => (f1.value, x2)
@@ -152,7 +152,7 @@ object Future:
152152
* If either task succeeds, succeed with the success that was returned first
153153
* and cancel the other. Otherwise, fail with the failure that was returned last.
154154
*/
155-
def alt[T2 >: T1](f2: Future[T2])(using AsyncConfig): Future[T2] = Future:
155+
def alt[T2 >: T1](f2: Future[T2])(using Async.Config): Future[T2] = Future:
156156
Async.await(Async.either(f1, f2)) match
157157
case Left(Success(x1)) => f2.cancel(); x1
158158
case Right(Success(x2)) => f1.cancel(); x2
@@ -187,7 +187,7 @@ end Future
187187
class Task[+T](val body: Async ?=> T):
188188

189189
/** Start a future computed from the `body` of this task */
190-
def run(using AsyncConfig) = Future(body)
190+
def run(using Async.Config) = Future(body)
191191

192192
end Task
193193

tests/pos/suspend-strawman-2/simple-futures.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package simpleFutures
33
import scala.collection.mutable.ListBuffer
44
import scala.util.boundary, boundary.Label
55
import runtime.*
6+
import concurrent.Scheduler
67

78
trait Async:
89
def await[T](f: Future[T]): T

0 commit comments

Comments
 (0)