我正在尝试将宏从 Scala 2.10 移植到 2.11.0-M7:
import scala.reflect.macros.Context
object Format {
def apply[A]: Unit = macro applyImpl[A]
def applyImpl[A: c.WeakTypeTag](c: Context): c.Expr[Unit] = ???
}
一定有什么改变了,因为编译器说不scala.reflect.macros.Context
存在。
我的构建文件如下所示:
scalaVersion := "2.11.0-M7"
resolvers += Resolver.sonatypeRepo("snapshots")
addCompilerPlugin("org.scala-lang.plugins" % "macro-paradise" % "2.0.0-SNAPSHOT"
cross CrossVersion.full)
有什么线索吗?