aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/macro-bundle-context-refinement/Macros_1.scala
blob: d3a5d179c60dd6a3236f3cbaab50ca3ddbb2c2e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.{Context => BlackboxContext}
import scala.reflect.macros.whitebox.{Context => WhiteboxContext}

class BlackboxBundle(val c: BlackboxContext { type PrefixType = C }) {
  import c.universe._
  def impl = reify(c.prefix.splice)
}

class WhiteboxBundle(val c: WhiteboxContext { type PrefixType = C }) {
  import c.universe._
  def impl = reify(c.prefix.splice)
}

class C {
  def blackbox: C = macro BlackboxBundle.impl
  def whitebox: C = macro WhiteboxBundle.impl
  override def toString = "C"
}