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.check | |
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.check')
-rw-r--r-- | test/files/neg/macro-invalidsig.check | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/test/files/neg/macro-invalidsig.check b/test/files/neg/macro-invalidsig.check index 732380d4b3..42b8db5628 100644 --- a/test/files/neg/macro-invalidsig.check +++ b/test/files/neg/macro-invalidsig.check @@ -1,77 +1,77 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context): c.Expr[Any] - or : (c: scala.reflect.macros.Context): c.Tree - found : (c: scala.reflect.macros.Context)(implicit evidence$2: Numeric[U]): c.universe.Literal + required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(implicit evidence$2: Numeric[U]): c.universe.Literal macro implementations cannot have implicit parameters other than WeakTypeTag evidences def foo[U] = macro Impls1.foo[U] ^ Macros_Test_2.scala:6: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context): c.Expr[Any] - or : (c: scala.reflect.macros.Context): c.Tree + required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext): c.Tree found : : Nothing number of parameter sections differ def foo = macro Impls2.foo ^ Macros_Test_2.scala:10: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context): c.Expr[Any] - or : (c: scala.reflect.macros.Context): c.Tree + required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext): c.Tree found : (c: scala.reflect.api.Universe): Nothing -type mismatch for parameter c: scala.reflect.macros.Context does not conform to scala.reflect.api.Universe +type mismatch for parameter c: scala.reflect.macros.BlackboxContext does not conform to scala.reflect.api.Universe def foo = macro Impls3.foo ^ Macros_Test_2.scala:14: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context): c.Expr[Any] - or : (c: scala.reflect.macros.Context): c.Tree - found : (cs: scala.reflect.macros.Context*): Nothing + required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext): c.Tree + found : (cs: scala.reflect.macros.BlackboxContext*): Nothing types incompatible for parameter cs: corresponding is not a vararg parameter def foo = macro Impls4.foo ^ Macros_Test_2.scala:18: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(x: c.Expr[Any]): c.Expr[Any] - or : (c: scala.reflect.macros.Context)(x: c.Tree): c.Tree - found : (c: scala.reflect.macros.Context): Nothing + required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Any]): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree + found : (c: scala.reflect.macros.BlackboxContext): Nothing number of parameter sections differ def foo(x: Any) = macro Impls5.foo ^ Macros_Test_2.scala:22: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Unit] - or : (c: scala.reflect.macros.Context)(x: c.Tree): c.Tree - found : (c: scala.reflect.macros.Context)(implicit x: c.Expr[Int]): c.Expr[Unit] + required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int]): c.Expr[Unit] + or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(implicit x: c.Expr[Int]): c.Expr[Unit] macro implementations cannot have implicit parameters other than WeakTypeTag evidences def foo[U](x: Int) = macro Impls6.foo[T, U] ^ Macros_Test_2.scala:26: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any] - or : (c: scala.reflect.macros.Context)(x: c.Tree): c.Tree - found : (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing + required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int]): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]): Nothing parameter lists have different length, found extra parameter y: c.Expr[Int] def foo(x: Int) = macro Impls7.foo ^ Macros_Test_2.scala:30: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any] - or : (c: scala.reflect.macros.Context)(x: c.Tree): c.Tree - found : (c: scala.reflect.macros.Context)(x: c.universe.Symbol): Nothing + required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int]): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(x: c.universe.Symbol): Nothing type mismatch for parameter x: c.Expr[Int] does not conform to c.universe.Symbol def foo(x: Int) = macro Impls8.foo ^ Macros_Test_2.scala:34: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] - or : (c: scala.reflect.macros.Context)(x: c.Tree, y: c.Tree): c.Tree - found : (c: scala.reflect.macros.Context)(xs: c.Expr[Int]*): Nothing + required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree, y: c.Tree): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(xs: c.Expr[Int]*): Nothing parameter lists have different length, required extra parameter y: c.Expr[Int] def foo(x: Int, y: Int) = macro Impls9.foo ^ Macros_Test_2.scala:38: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] - or : (c: scala.reflect.macros.Context)(x: c.Tree, y: c.Tree): c.Tree - found : (c: scala.reflect.macros.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing + required: (c: scala.reflect.macros.BlackboxContext)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext)(x: c.Tree, y: c.Tree): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(y: c.Expr[Int], x: c.Expr[Int]): Nothing parameter names differ: x != y def foo(x: Int, y: Int) = macro Impls10.foo ^ Macros_Test_2.scala:42: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context): c.Expr[Any] - or : (c: scala.reflect.macros.Context): c.Tree - found : (c: scala.reflect.macros.Context)(U: c.universe.Type): Nothing + required: (c: scala.reflect.macros.BlackboxContext): c.Expr[Any] + or : (c: scala.reflect.macros.BlackboxContext): c.Tree + found : (c: scala.reflect.macros.BlackboxContext)(U: c.universe.Type): Nothing number of parameter sections differ def foo[U] = macro Impls11.foo[U] ^ @@ -81,13 +81,13 @@ Macros_Test_2.scala:46: error: type arguments [U] do not conform to method foo's Macros_Test_2.scala:50: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] def foo[U <: Int] = macro Impls13.foo[U] ^ -Macros_Test_2.scala:54: error: wrong number of type parameters for method foo: [U](c: scala.reflect.macros.Context)(implicit evidence$4: c.WeakTypeTag[U])Nothing +Macros_Test_2.scala:54: error: wrong number of type parameters for method foo: [U](c: scala.reflect.macros.BlackboxContext)(implicit evidence$4: c.WeakTypeTag[U])Nothing def foo = macro Impls14.foo ^ -Macros_Test_2.scala:59: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.Context)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] +Macros_Test_2.scala:59: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.BlackboxContext)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] def foo15[V] = macro Impls15.foo ^ -Macros_Test_2.scala:60: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.Context)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] +Macros_Test_2.scala:60: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.BlackboxContext)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] def foo16[V] = macro Impls16.foo[V] ^ 16 errors found |