diff options
Diffstat (limited to 'test/files')
18 files changed, 45 insertions, 20 deletions
diff --git a/test/files/neg/macro-invalidshape-a.check b/test/files/neg/macro-invalidshape-a.check index 246b5c3226..098ec35a00 100644 --- a/test/files/neg/macro-invalidshape-a.check +++ b/test/files/neg/macro-invalidshape-a.check @@ -1,6 +1,5 @@ Macros_Test_2.scala:2: error: macro body has wrong shape:
- required: macro <reference to implementation object>.<implementation method name>
- or : macro <implementation method name>
+ required: macro [<implementation object>].<method name>[[<type args>]]
def foo(x: Any) = macro 2
^
one error found
diff --git a/test/files/neg/macro-invalidshape-b.check b/test/files/neg/macro-invalidshape-b.check index 59701d023b..297ff69199 100644 --- a/test/files/neg/macro-invalidshape-b.check +++ b/test/files/neg/macro-invalidshape-b.check @@ -1,6 +1,5 @@ Macros_Test_2.scala:2: error: macro body has wrong shape:
- required: macro <reference to implementation object>.<implementation method name>
- or : macro <implementation method name>
+ required: macro [<implementation object>].<method name>[[<type args>]]
def foo(x: Any) = macro Impls.foo(null)(null)
^
one error found
diff --git a/test/files/neg/macro-invalidshape-c.check b/test/files/neg/macro-invalidshape-c.check index 84d8c35222..6513df166e 100644 --- a/test/files/neg/macro-invalidshape-c.check +++ b/test/files/neg/macro-invalidshape-c.check @@ -1,6 +1,9 @@ -Macros_Test_2.scala:2: error: macro body has wrong shape:
- required: macro <reference to implementation object>.<implementation method name>
- or : macro <implementation method name>
+Macros_Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
def foo(x: Any) = macro {2; Impls.foo}
- ^
+ ^
+Macros_Test_2.scala:2: error: missing arguments for method foo in object Impls;
+follow this method with `_' if you want to treat it as a partially applied function
+ def foo(x: Any) = macro {2; Impls.foo}
+ ^
+one warning found
one error found
diff --git a/test/files/neg/macro-invalidsig-context-bounds.check b/test/files/neg/macro-invalidsig-context-bounds.check index 6c9482e537..5d42ebc515 100644 --- a/test/files/neg/macro-invalidsig-context-bounds.check +++ b/test/files/neg/macro-invalidsig-context-bounds.check @@ -1,4 +1,7 @@ -Impls_1.scala:5: error: macro implementations cannot have implicit parameters other than AbsTypeTag evidences - def foo[U: c.AbsTypeTag: Numeric](c: Ctx) = { - ^ -one error found +Macros_Test_1.scala:2: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context): c.Expr[Any]
+ found : (c: scala.reflect.macros.Context)(implicit evidence$2: Numeric[U]): c.universe.Literal
+macro implementations cannot have implicit parameters other than AbsTypeTag evidences
+ def foo[U] = macro Impls.foo[U]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-implicit-params.check b/test/files/neg/macro-invalidsig-implicit-params.check index 98b3167b7a..62156770e4 100644 --- a/test/files/neg/macro-invalidsig-implicit-params.check +++ b/test/files/neg/macro-invalidsig-implicit-params.check @@ -1,4 +1,7 @@ -Impls_Macros_1.scala:5: error: macro implementations cannot have implicit parameters other than AbsTypeTag evidences - def foo_targs[T, U: c.AbsTypeTag](c: Ctx)(implicit x: c.Expr[Int]) = { - ^ -one error found +Impls_Macros_1.scala:18: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Unit]
+ found : (c: scala.reflect.macros.Context)(implicit x: c.Expr[Int]): c.Expr[Unit]
+macro implementations cannot have implicit parameters other than AbsTypeTag evidences
+ def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U]
+ ^
+one error found
diff --git a/test/files/neg/macro-invalidsig-params-namemismatch.check b/test/files/neg/macro-invalidsig-params-namemismatch.check index f2639d9350..00d781a2ac 100644 --- a/test/files/neg/macro-invalidsig-params-namemismatch.check +++ b/test/files/neg/macro-invalidsig-params-namemismatch.check @@ -2,7 +2,6 @@ Impls_Macros_1.scala:8: error: macro implementation has wrong shape: required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any]
found : (c: scala.reflect.macros.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing
parameter names differ: x != y
-parameter names differ: y != x
def foo(x: Int, y: Int) = macro Impls.foo
^
one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-badtype.check b/test/files/neg/macro-invalidsig-tparams-badtype.check index e5e8366ba4..20c58ff2bb 100644 --- a/test/files/neg/macro-invalidsig-tparams-badtype.check +++ b/test/files/neg/macro-invalidsig-tparams-badtype.check @@ -3,5 +3,5 @@ Macros_Test_2.scala:2: error: macro implementation has wrong shape: found : (c: scala.reflect.macros.Context)(U: c.universe.Type): Nothing
number of parameter sections differ
def foo[U] = macro Impls.foo[U]
- ^
+ ^
one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a.check b/test/files/neg/macro-invalidsig-tparams-notparams-a.check index 5b4ef42ea5..5aee62b9e5 100644 --- a/test/files/neg/macro-invalidsig-tparams-notparams-a.check +++ b/test/files/neg/macro-invalidsig-tparams-notparams-a.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:2: error: macro implementation reference needs type arguments
+Macros_Test_2.scala:2: error: wrong number of type parameters for method foo: [U](c: scala.reflect.macros.Context)(implicit evidence$1: c.AbsTypeTag[U])Nothing
def foo = macro Impls.foo
^
one error found
diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b.check b/test/files/neg/macro-invalidsig-tparams-notparams-b.check index 261e3b8293..e8de8a4c6b 100644 --- a/test/files/neg/macro-invalidsig-tparams-notparams-b.check +++ b/test/files/neg/macro-invalidsig-tparams-notparams-b.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:3: error: macro implementation reference needs type arguments
+Macros_Test_2.scala:3: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.Context)(implicit evidence$1: c.AbsTypeTag[T], implicit evidence$2: c.AbsTypeTag[U], implicit V: c.AbsTypeTag[V])c.Expr[Unit]
def foo[V] = macro Impls.foo
^
one error found
diff --git a/test/files/run/macro-def-path-dependent-d.check b/test/files/run/macro-def-path-dependent-d1.check index 1ea14b4e20..1ea14b4e20 100644 --- a/test/files/run/macro-def-path-dependent-d.check +++ b/test/files/run/macro-def-path-dependent-d1.check diff --git a/test/files/run/macro-def-path-dependent-d.flags b/test/files/run/macro-def-path-dependent-d1.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-def-path-dependent-d.flags +++ b/test/files/run/macro-def-path-dependent-d1.flags diff --git a/test/files/run/macro-def-path-dependent-d/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala index 2daf6fc3fb..2daf6fc3fb 100644 --- a/test/files/run/macro-def-path-dependent-d/Impls_Macros_1.scala +++ b/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala diff --git a/test/files/run/macro-def-path-dependent-d/Test_2.scala b/test/files/run/macro-def-path-dependent-d1/Test_2.scala index 7dffc5107d..7dffc5107d 100644 --- a/test/files/run/macro-def-path-dependent-d/Test_2.scala +++ b/test/files/run/macro-def-path-dependent-d1/Test_2.scala diff --git a/test/files/run/macro-def-path-dependent-d2.check b/test/files/run/macro-def-path-dependent-d2.check new file mode 100644 index 0000000000..1ea14b4e20 --- /dev/null +++ b/test/files/run/macro-def-path-dependent-d2.check @@ -0,0 +1 @@ +it works
diff --git a/test/files/run/macro-def-path-dependent-d2.flags b/test/files/run/macro-def-path-dependent-d2.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/files/run/macro-def-path-dependent-d2.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d2/Impls_1.scala b/test/files/run/macro-def-path-dependent-d2/Impls_1.scala new file mode 100644 index 0000000000..1cda64e43e --- /dev/null +++ b/test/files/run/macro-def-path-dependent-d2/Impls_1.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.Context +import scala.reflect.api.Universe + +object Impls { + def materializeTypeTag_impl[T: c.AbsTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? +}
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d2/Macros_2.scala b/test/files/run/macro-def-path-dependent-d2/Macros_2.scala new file mode 100644 index 0000000000..65ce4d8bd2 --- /dev/null +++ b/test/files/run/macro-def-path-dependent-d2/Macros_2.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.Context +import scala.reflect.api.Universe + +object Macros { + def materializeTypeTag[T](u: Universe)(e: T) = macro Impls.materializeTypeTag_impl[T] +}
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d2/Test_3.scala b/test/files/run/macro-def-path-dependent-d2/Test_3.scala new file mode 100644 index 0000000000..7dffc5107d --- /dev/null +++ b/test/files/run/macro-def-path-dependent-d2/Test_3.scala @@ -0,0 +1,3 @@ +object Test extends App { + println("it works") +}
\ No newline at end of file |