blob: 4af69bc167fb90c383aee0a735487735422bbba5 (
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
24
25
26
27
28
29
30
31
32
33
|
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 = {
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 macroApplication: global.Tree = c0.macroApplication.asInstanceOf[global.Tree]
// This member is required by `AsyncTransform`:
val asyncBase: AsyncBase = base
// These members are required by `ExprBuilder`:
val futureSystem: FutureSystem = base.futureSystem
val futureSystemOps: futureSystem.Ops {val c: self.c.type} = futureSystem.mkOps(c)
}
}
}
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 macroApplication: global.Tree
lazy val macroPos = macroApplication.pos.makeTransparent
def atMacroPos(t: global.Tree) = global.atPos(macroPos)(t)
}
|