blob: f12c8f7dcc6c887f4c5a0d07d3b90d861c481623 (
plain) (
tree)
|
|
import scala.reflect.macros.Context
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: Context) = {
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: Context) = {
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
}
}
|