summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/macro-bundle-ambiguous.check5
-rw-r--r--test/files/neg/macro-bundle-ambiguous.scala14
-rw-r--r--test/files/neg/macro-bundle-priority-bundle.check8
-rw-r--r--test/files/neg/macro-bundle-priority-bundle.scala14
-rw-r--r--test/files/neg/macro-bundle-priority-nonbundle.check8
-rw-r--r--test/files/neg/macro-bundle-priority-nonbundle.scala14
-rw-r--r--test/files/neg/macro-quasiquotes.check2
-rw-r--r--test/files/pos/macro-bundle-disambiguate-bundle.check0
-rw-r--r--test/files/pos/macro-bundle-disambiguate-bundle.scala14
-rw-r--r--test/files/pos/macro-bundle-disambiguate-nonbundle.check0
-rw-r--r--test/files/pos/macro-bundle-disambiguate-nonbundle.scala14
11 files changed, 92 insertions, 1 deletions
diff --git a/test/files/neg/macro-bundle-ambiguous.check b/test/files/neg/macro-bundle-ambiguous.check
new file mode 100644
index 0000000000..8430496455
--- /dev/null
+++ b/test/files/neg/macro-bundle-ambiguous.check
@@ -0,0 +1,5 @@
+macro-bundle-ambiguous.scala:13: error: macro implementation reference is ambiguous: makes sense both as
+a macro bundle method reference and a vanilla object method reference
+ def foo: Unit = macro Macros.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-bundle-ambiguous.scala b/test/files/neg/macro-bundle-ambiguous.scala
new file mode 100644
index 0000000000..92c359d9a9
--- /dev/null
+++ b/test/files/neg/macro-bundle-ambiguous.scala
@@ -0,0 +1,14 @@
+import scala.reflect.macros.whitebox._
+import scala.language.experimental.macros
+
+class Macros(val c: Context) {
+ def impl = ???
+}
+
+object Macros {
+ def impl(c: Context) = ???
+}
+
+object Test extends App {
+ def foo: Unit = macro Macros.impl
+} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-priority-bundle.check b/test/files/neg/macro-bundle-priority-bundle.check
new file mode 100644
index 0000000000..c6cea72ba6
--- /dev/null
+++ b/test/files/neg/macro-bundle-priority-bundle.check
@@ -0,0 +1,8 @@
+macro-bundle-priority-bundle.scala:13: error: bundle implementation has incompatible shape:
+ required: : Macros.this.c.Expr[Unit]
+ or : : Macros.this.c.Tree
+ found : (x: Macros.this.c.Tree): Nothing
+number of parameter sections differ
+ def foo: Unit = macro Macros.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-bundle-priority-bundle.scala b/test/files/neg/macro-bundle-priority-bundle.scala
new file mode 100644
index 0000000000..ce831a7121
--- /dev/null
+++ b/test/files/neg/macro-bundle-priority-bundle.scala
@@ -0,0 +1,14 @@
+import scala.reflect.macros.whitebox._
+import scala.language.experimental.macros
+
+class Macros(val c: Context) {
+ def impl(x: c.Tree) = ???
+}
+
+object Macros {
+ def impl(c: Context)(x: c.Tree) = ???
+}
+
+object Test extends App {
+ def foo: Unit = macro Macros.impl
+} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-priority-nonbundle.check b/test/files/neg/macro-bundle-priority-nonbundle.check
new file mode 100644
index 0000000000..0d03b5074b
--- /dev/null
+++ b/test/files/neg/macro-bundle-priority-nonbundle.check
@@ -0,0 +1,8 @@
+macro-bundle-priority-nonbundle.scala:13: error: macro implementation has incompatible shape:
+ required: (c: scala.reflect.macros.whitebox.Context): c.Expr[Unit]
+ or : (c: scala.reflect.macros.whitebox.Context): c.Tree
+ found : (c: scala.reflect.macros.whitebox.Context)(x: c.Tree): Nothing
+number of parameter sections differ
+ def foo: Unit = macro Macros.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-bundle-priority-nonbundle.scala b/test/files/neg/macro-bundle-priority-nonbundle.scala
new file mode 100644
index 0000000000..8dc00f6dd3
--- /dev/null
+++ b/test/files/neg/macro-bundle-priority-nonbundle.scala
@@ -0,0 +1,14 @@
+import scala.reflect.macros.whitebox._
+import scala.language.experimental.macros
+
+class Macros(val c: scala.reflect.api.Universe) {
+ def impl(x: c.Tree) = ???
+}
+
+object Macros {
+ def impl(c: Context)(x: c.Tree) = ???
+}
+
+object Test extends App {
+ def foo: Unit = macro Macros.impl
+} \ No newline at end of file
diff --git a/test/files/neg/macro-quasiquotes.check b/test/files/neg/macro-quasiquotes.check
index c690b61fe1..a985aee156 100644
--- a/test/files/neg/macro-quasiquotes.check
+++ b/test/files/neg/macro-quasiquotes.check
@@ -1,4 +1,4 @@
-Macros_1.scala:14: error: macro implementation has incompatible shape:
+Macros_1.scala:14: error: bundle implementation has incompatible shape:
required: (x: Impls.this.c.Expr[Int]): Impls.this.c.Expr[Unit]
or : (x: Impls.this.c.Tree): Impls.this.c.Tree
found : (x: Impls.this.c.universe.Block): Impls.this.c.Tree
diff --git a/test/files/pos/macro-bundle-disambiguate-bundle.check b/test/files/pos/macro-bundle-disambiguate-bundle.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/pos/macro-bundle-disambiguate-bundle.check
diff --git a/test/files/pos/macro-bundle-disambiguate-bundle.scala b/test/files/pos/macro-bundle-disambiguate-bundle.scala
new file mode 100644
index 0000000000..04809317e1
--- /dev/null
+++ b/test/files/pos/macro-bundle-disambiguate-bundle.scala
@@ -0,0 +1,14 @@
+import scala.reflect.macros.whitebox._
+import scala.language.experimental.macros
+
+class Macros(val c: Context) {
+ def impl = ???
+}
+
+object Macros {
+ def impl(c: Context)(x: c.Tree) = ???
+}
+
+object Test extends App {
+ def foo: Unit = macro Macros.impl
+} \ No newline at end of file
diff --git a/test/files/pos/macro-bundle-disambiguate-nonbundle.check b/test/files/pos/macro-bundle-disambiguate-nonbundle.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/pos/macro-bundle-disambiguate-nonbundle.check
diff --git a/test/files/pos/macro-bundle-disambiguate-nonbundle.scala b/test/files/pos/macro-bundle-disambiguate-nonbundle.scala
new file mode 100644
index 0000000000..cb66f28a0b
--- /dev/null
+++ b/test/files/pos/macro-bundle-disambiguate-nonbundle.scala
@@ -0,0 +1,14 @@
+import scala.reflect.macros.whitebox._
+import scala.language.experimental.macros
+
+class Macros(val c: Context) {
+ def impl(x: c.Tree) = ???
+}
+
+object Macros {
+ def impl(c: Context) = ???
+}
+
+object Test extends App {
+ def foo: Unit = macro Macros.impl
+} \ No newline at end of file