diff options
Diffstat (limited to 'src/main/scala/scala/async/internal/AsyncMacro.scala')
-rw-r--r-- | src/main/scala/scala/async/internal/AsyncMacro.scala | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/main/scala/scala/async/internal/AsyncMacro.scala b/src/main/scala/scala/async/internal/AsyncMacro.scala index 30aa1dd..e969f9b 100644 --- a/src/main/scala/scala/async/internal/AsyncMacro.scala +++ b/src/main/scala/scala/async/internal/AsyncMacro.scala @@ -1,19 +1,14 @@ package scala.async.internal -import scala.tools.nsc.Global -import scala.tools.nsc.transform.TypingTransformers - object AsyncMacro { - def apply(c0: reflect.macros.Context, base: AsyncBase): AsyncMacro = { + def apply(c0: reflect.macros.Context, base: AsyncBase): AsyncMacro { val c: c0.type } = { import language.reflectiveCalls - val powerContext = c0.asInstanceOf[c0.type { val universe: Global; val callsiteTyper: universe.analyzer.Typer }] new AsyncMacro { self => - val c: scala.reflect.macros.Context { val universe: global.type } = c0.asInstanceOf[scala.reflect.macros.Context { val universe: global.type }] - val global: powerContext.universe.type = powerContext.universe + val c: c0.type = c0 // This member is required by `AsyncTransform`: - val asyncBase: AsyncBase = base + val asyncBase: AsyncBase = base // These members are required by `ExprBuilder`: - val futureSystem: FutureSystem = base.futureSystem + val futureSystem: FutureSystem = base.futureSystem val futureSystemOps: futureSystem.Ops {val c: self.c.type} = futureSystem.mkOps(c) } } @@ -23,9 +18,8 @@ private[async] trait AsyncMacro extends AnfTransform with TransformUtils with Lifter with ExprBuilder with AsyncTransform with AsyncAnalysis with LiveVariables { - val c: scala.reflect.macros.Context { val universe: global.type } - val global: Global + val c: scala.reflect.macros.Context lazy val macroPos = c.macroApplication.pos.makeTransparent - def atMacroPos(t: global.Tree) = c.universe.atPos(macroPos)(t) + def atMacroPos(t: c.Tree) = c.universe.atPos(macroPos)(t) } |