summaryrefslogblamecommitdiff
path: root/test/files/run/macro-reify-staticXXX/Macros_1.scala
blob: 077271d582a6a9b9134c8884252ab2e2cd5226cb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
                                           














                                                         
                                  















                               
                                    













                                 
import scala.reflect.macros.BlackboxContext

object B { override def toString = "object" }
class C { override def toString = "class" }

package foo {
  object B { override def toString = "package > object" }
  class C { override def toString = "package > class" }
}

object foo {
  object B { override def toString = "object > object" }
  class C { override def toString = "object > class" }
}

object packageless {
  def impl(c: BlackboxContext) = {
    import c.universe._
    reify {
      println(B)
      println(new C)
      println(foo.B)
      println(new foo.C)
      println(_root_.foo.B)
      println(new _root_.foo.C)
    }
  }

  def test = macro impl
}

package packageful {
  object Test {
    def impl(c: BlackboxContext) = {
      import c.universe._
      reify {
        println(B)
        println(new C)
        println(foo.B)
        println(new foo.C)
        println(_root_.foo.B)
        println(new _root_.foo.C)
      }
    }

    def test = macro impl
  }
}