Skip to content

Commit 5bfc28f

Browse files
committed
Fix deprecation warnings Context -> whitebox.Context
1 parent 8d4c7c3 commit 5bfc28f

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/main/scala/scala/async/internal/AsyncBase.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
package scala.async.internal
1414

1515
import scala.reflect.internal.annotations.compileTimeOnly
16-
import scala.reflect.macros.Context
16+
import scala.reflect.macros.whitebox
1717
import scala.reflect.api.Universe
1818

1919
/**
@@ -47,7 +47,7 @@ abstract class AsyncBase {
4747
@compileTimeOnly("`await` must be enclosed in an `async` block")
4848
def await[T](awaitable: futureSystem.Fut[T]): T = ???
4949

50-
def asyncImpl[T: c.WeakTypeTag](c: Context)
50+
def asyncImpl[T: c.WeakTypeTag](c: whitebox.Context)
5151
(body: c.Expr[T])
5252
(execContext: c.Expr[futureSystem.ExecContext]): c.Expr[futureSystem.Fut[T]] = {
5353
import c.universe._, c.internal._, decorators._

src/main/scala/scala/async/internal/AsyncId.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
package scala.async.internal
1414

1515
import language.experimental.macros
16-
import scala.reflect.macros.Context
16+
import scala.reflect.macros.whitebox
1717
import scala.reflect.api.Universe
1818

1919
object AsyncId extends AsyncBase {
@@ -22,7 +22,7 @@ object AsyncId extends AsyncBase {
2222

2323
def async[T](body: => T): T = macro asyncIdImpl[T]
2424

25-
def asyncIdImpl[T: c.WeakTypeTag](c: Context)(body: c.Expr[T]): c.Expr[T] = asyncImpl[T](c)(body)(c.literalUnit)
25+
def asyncIdImpl[T: c.WeakTypeTag](c: whitebox.Context)(body: c.Expr[T]): c.Expr[T] = asyncImpl[T](c)(body)(c.literalUnit)
2626
}
2727

2828
object AsyncTestLV extends AsyncBase {
@@ -31,7 +31,7 @@ object AsyncTestLV extends AsyncBase {
3131

3232
def async[T](body: T): T = macro asyncIdImpl[T]
3333

34-
def asyncIdImpl[T: c.WeakTypeTag](c: Context)(body: c.Expr[T]): c.Expr[T] = asyncImpl[T](c)(body)(c.literalUnit)
34+
def asyncIdImpl[T: c.WeakTypeTag](c: whitebox.Context)(body: c.Expr[T]): c.Expr[T] = asyncImpl[T](c)(body)(c.literalUnit)
3535

3636
var log: List[(String, Any)] = Nil
3737
def assertNulledOut(a: Any): Unit = assert(log.exists(_._2 == a), AsyncTestLV.log)
@@ -59,7 +59,7 @@ object IdentityFutureSystem extends FutureSystem {
5959
type ExecContext = Unit
6060
type Tryy[A] = scala.util.Try[A]
6161

62-
def mkOps(c0: Context): Ops {val c: c0.type} = new Ops {
62+
def mkOps(c0: whitebox.Context): Ops {val c: c0.type} = new Ops {
6363
val c: c0.type = c0
6464
import c.universe._
6565

src/main/scala/scala/async/internal/AsyncMacro.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
package scala.async.internal
1414

1515
object AsyncMacro {
16-
def apply(c0: reflect.macros.Context, base: AsyncBase)(body0: c0.Tree): AsyncMacro { val c: c0.type } = {
16+
def apply(c0: reflect.macros.whitebox.Context, base: AsyncBase)(body0: c0.Tree): AsyncMacro { val c: c0.type } = {
1717
import language.reflectiveCalls
1818

1919
// Use an attachment on RootClass as a sneaky place for a per-Global cache
@@ -42,7 +42,7 @@ private[async] trait AsyncMacro
4242
extends AnfTransform with TransformUtils with Lifter
4343
with ExprBuilder with AsyncTransform with AsyncAnalysis with LiveVariables {
4444

45-
val c: scala.reflect.macros.Context
45+
val c: scala.reflect.macros.whitebox.Context
4646
val body: c.Tree
4747
var containsAwait: c.Tree => Boolean
4848
val asyncNames: AsyncNames[c.universe.type]

src/main/scala/scala/async/internal/FutureSystem.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
package scala.async.internal
1414

1515
import scala.language.higherKinds
16-
import scala.reflect.macros.Context
16+
import scala.reflect.macros.whitebox
1717

1818
/**
1919
* An abstraction over a future system.
@@ -36,7 +36,7 @@ trait FutureSystem {
3636
type Tryy[T]
3737

3838
trait Ops {
39-
val c: Context
39+
val c: whitebox.Context
4040
import c.universe._
4141

4242
def promType[A: WeakTypeTag]: Type
@@ -85,7 +85,7 @@ trait FutureSystem {
8585
def dot(enclosingOwner: Symbol, macroApplication: Tree): Option[(String => Unit)] = None
8686
}
8787

88-
def mkOps(c0: Context): Ops { val c: c0.type }
88+
def mkOps(c0: whitebox.Context): Ops { val c: c0.type }
8989

9090
@deprecated("No longer honoured by the macro, all generated names now contain $async to avoid accidental clashes with lambda lifted names", "0.9.7")
9191
def freshenAllNames: Boolean = false
@@ -103,7 +103,7 @@ object ScalaConcurrentFutureSystem extends FutureSystem {
103103
type ExecContext = ExecutionContext
104104
type Tryy[A] = scala.util.Try[A]
105105

106-
def mkOps(c0: Context): Ops {val c: c0.type} = new Ops {
106+
def mkOps(c0: whitebox.Context): Ops {val c: c0.type} = new Ops {
107107
val c: c0.type = c0
108108
import c.universe._
109109

src/main/scala/scala/async/internal/ScalaConcurrentAsync.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ package async
1515
package internal
1616

1717
import scala.language.experimental.macros
18-
import scala.reflect.macros.Context
18+
import scala.reflect.macros.whitebox
1919
import scala.concurrent.Future
2020

2121
object ScalaConcurrentAsync extends AsyncBase {
2222
type FS = ScalaConcurrentFutureSystem.type
2323
val futureSystem: FS = ScalaConcurrentFutureSystem
2424

25-
override def asyncImpl[T: c.WeakTypeTag](c: Context)
25+
override def asyncImpl[T: c.WeakTypeTag](c: whitebox.Context)
2626
(body: c.Expr[T])
2727
(execContext: c.Expr[futureSystem.ExecContext]): c.Expr[Future[T]] = {
2828
super.asyncImpl[T](c)(body)(execContext)

0 commit comments

Comments
 (0)