aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/continuations/CPSBasedAsyncBase.scala
blob: a350704d5230bf60d1b4e03f9754319f49e3cb01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * Copyright (C) 2012 Typesafe Inc. <http://www.typesafe.com>
 */

package scala.async
package continuations

import scala.language.experimental.macros

import scala.reflect.macros.Context
import scala.util.continuations._

/* Specializes `AsyncBaseWithCPSFallback` to always fall back to CPS, yielding a purely CPS-based
 * implementation of async/await.
 */
trait CPSBasedAsyncBase extends AsyncBaseWithCPSFallback {

  override def asyncImpl[T: c.WeakTypeTag](c: Context)
                                          (body: c.Expr[T])
                                          (execContext: c.Expr[futureSystem.ExecContext]): c.Expr[futureSystem.Fut[T]] = {
    super.cpsBasedAsyncImpl[T](c)(body)(execContext)
  }
}