diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-10-02 16:47:11 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-12 18:40:01 -0800 |
commit | ce37ae45e22463a3f1a2d659d6699f2977b26c6b (patch) | |
tree | c10f54142a9db9653c6c8518e579987093e753ed /test/files/neg/macro-invalidsig | |
parent | beed16825e53077c40ff38b035bfaafb3a4e39d5 (diff) | |
download | scala-ce37ae45e22463a3f1a2d659d6699f2977b26c6b.tar.gz scala-ce37ae45e22463a3f1a2d659d6699f2977b26c6b.tar.bz2 scala-ce37ae45e22463a3f1a2d659d6699f2977b26c6b.zip |
blackbox and whitebox macros
This is the first commit in the series. This commit only:
1) Splits Context into BlackboxContext and WhiteboxContext
2) Splits Macro into BlackboxMacro and WhiteboxMacro
3) Introduces the isBundle property in the macro impl binding
Here we just teach the compiler that macros can now be blackbox and whitebox,
without actually imposing any restrictions on blackbox macros. These
restrictions will come in subsequent commits.
For description and documentation of the blackbox/whitebox separation
see the official macro guide at the scaladoc website:
http://docs.scala-lang.org/overviews/macros/blackbox-whitebox.html
Some infrastructure work to make evolving macros easier:
compile partest-extras with quick so they can use latest library/reflect/...
Diffstat (limited to 'test/files/neg/macro-invalidsig')
-rw-r--r-- | test/files/neg/macro-invalidsig/Impls_1.scala | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/files/neg/macro-invalidsig/Impls_1.scala b/test/files/neg/macro-invalidsig/Impls_1.scala index d16ed26386..7c98160925 100644 --- a/test/files/neg/macro-invalidsig/Impls_1.scala +++ b/test/files/neg/macro-invalidsig/Impls_1.scala @@ -1,8 +1,8 @@ import scala.reflect.runtime.universe._ -import scala.reflect.macros.Context +import scala.reflect.macros.BlackboxContext object Impls1 { - def foo[U: c.WeakTypeTag: Numeric](c: Context) = { import c.universe._; q"42" } + def foo[U: c.WeakTypeTag: Numeric](c: BlackboxContext) = { import c.universe._; q"42" } } object Impls2 { @@ -14,15 +14,15 @@ object Impls3 { } object Impls4 { - def foo(cs: Context*) = ??? + def foo(cs: BlackboxContext*) = ??? } object Impls5 { - def foo(c: Context) = ??? + def foo(c: BlackboxContext) = ??? } object Impls6 { - def foo[T, U: c.WeakTypeTag](c: Context)(implicit x: c.Expr[Int]) = { + def foo[T, U: c.WeakTypeTag](c: BlackboxContext)(implicit x: c.Expr[Int]) = { import c.{prefix => prefix} import c.universe._ c.Expr[Unit](q""" @@ -34,39 +34,39 @@ object Impls6 { } object Impls7 { - def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = ??? + def foo(c: BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]) = ??? } object Impls8 { - def foo(c: Context)(x: c.universe.Symbol) = ??? + def foo(c: BlackboxContext)(x: c.universe.Symbol) = ??? } object Impls9 { - def foo(c: Context)(xs: c.Expr[Int]*) = ??? + def foo(c: BlackboxContext)(xs: c.Expr[Int]*) = ??? } object Impls10 { - def foo(c: Context)(y: c.Expr[Int], x: c.Expr[Int]) = ??? + def foo(c: BlackboxContext)(y: c.Expr[Int], x: c.Expr[Int]) = ??? } object Impls11 { - def foo[U](c: Context)(U: c.universe.Type) = ??? + def foo[U](c: BlackboxContext)(U: c.universe.Type) = ??? } object Impls12 { - def foo[U <: String](c: Context) = ??? + def foo[U <: String](c: BlackboxContext) = ??? } object Impls13 { - def foo[U <: String](c: Context) = ??? + def foo[U <: String](c: BlackboxContext) = ??? } object Impls14 { - def foo[U: c.WeakTypeTag](c: Context) = ??? + def foo[U: c.WeakTypeTag](c: BlackboxContext) = ??? } object Impls15 { - def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Context)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: BlackboxContext)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ println(implicitly[c.WeakTypeTag[T]]) println(implicitly[c.WeakTypeTag[U]]) @@ -76,7 +76,7 @@ object Impls15 { } object Impls16 { - def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Context)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: BlackboxContext)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ println(implicitly[c.WeakTypeTag[T]]) println(implicitly[c.WeakTypeTag[U]]) |