summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-12 00:17:25 +0100
committerEugene Burmako <xeno.by@gmail.com>2014-01-12 18:03:51 +0100
commit3a689f5c426436aea716567625fd6167e57bef92 (patch)
tree46871d70acc7d3cd83e7433f217e362a796e8f30 /test/files/neg
parent5cc8f83c681ded7367dc5112f6f9042e9526facf (diff)
downloadscala-3a689f5c426436aea716567625fd6167e57bef92.tar.gz
scala-3a689f5c426436aea716567625fd6167e57bef92.tar.bz2
scala-3a689f5c426436aea716567625fd6167e57bef92.zip
changes bundles to be classes, not traits extending Macro
Adjusts bundle notation to read `class Bundle(val c: Context)` instead of `class Bundle extends Macro`. This avoids calling compileLate in the macro compiler and associated tooling problems.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/macro-bundle-abstract.check6
-rw-r--r--test/files/neg/macro-bundle-abstract.scala4
-rw-r--r--test/files/neg/macro-bundle-class.check4
-rw-r--r--test/files/neg/macro-bundle-class.scala10
-rw-r--r--test/files/neg/macro-bundle-mixbox.check4
-rw-r--r--test/files/neg/macro-bundle-mixbox.scala11
-rw-r--r--test/files/neg/macro-bundle-noncontext.check4
-rw-r--r--test/files/neg/macro-bundle-noncontext.scala (renamed from test/files/neg/macro-bundle-nonmacro.scala)2
-rw-r--r--test/files/neg/macro-bundle-nonmacro.check4
-rw-r--r--test/files/neg/macro-bundle-object.scala4
-rw-r--r--test/files/neg/macro-bundle-polymorphic.check10
-rw-r--r--test/files/neg/macro-bundle-polymorphic.scala12
-rw-r--r--test/files/neg/macro-bundle-trait.check2
-rw-r--r--test/files/neg/macro-bundle-trait.scala4
-rw-r--r--test/files/neg/macro-quasiquotes/Macros_1.scala4
15 files changed, 17 insertions, 68 deletions
diff --git a/test/files/neg/macro-bundle-abstract.check b/test/files/neg/macro-bundle-abstract.check
index 8766e2a436..010d0768c9 100644
--- a/test/files/neg/macro-bundle-abstract.check
+++ b/test/files/neg/macro-bundle-abstract.check
@@ -1,4 +1,4 @@
-macro-bundle-abstract.scala:4: error: class Bundle$Bundle needs to be abstract, since method deferred in trait Bundle of type => Int is not defined
-trait Bundle extends Macro {
- ^
+macro-bundle-abstract.scala:10: error: macro bundles must be concrete classes having a single `val c: Context` parameter
+ def foo = macro Bundle.impl
+ ^
one error found
diff --git a/test/files/neg/macro-bundle-abstract.scala b/test/files/neg/macro-bundle-abstract.scala
index 4ed2f4f7e5..0afeaafc01 100644
--- a/test/files/neg/macro-bundle-abstract.scala
+++ b/test/files/neg/macro-bundle-abstract.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.blackbox.Macro
+import scala.reflect.macros.blackbox.Context
-trait Bundle extends Macro {
+abstract class Bundle(c: Context) {
def deferred: Int
def impl = ???
}
diff --git a/test/files/neg/macro-bundle-class.check b/test/files/neg/macro-bundle-class.check
deleted file mode 100644
index 95ba45b169..0000000000
--- a/test/files/neg/macro-bundle-class.check
+++ /dev/null
@@ -1,4 +0,0 @@
-macro-bundle-class.scala:9: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
- def foo = macro Bundle.impl
- ^
-one error found
diff --git a/test/files/neg/macro-bundle-class.scala b/test/files/neg/macro-bundle-class.scala
deleted file mode 100644
index 40a7ae0625..0000000000
--- a/test/files/neg/macro-bundle-class.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-import scala.language.experimental.macros
-import scala.reflect.macros.blackbox._
-
-class Bundle(val c: Context) extends Macro {
- def impl = ???
-}
-
-object Macros {
- def foo = macro Bundle.impl
-} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-mixbox.check b/test/files/neg/macro-bundle-mixbox.check
deleted file mode 100644
index 38aad273ea..0000000000
--- a/test/files/neg/macro-bundle-mixbox.check
+++ /dev/null
@@ -1,4 +0,0 @@
-macro-bundle-mixbox.scala:10: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
- def foo = macro Bundle.impl
- ^
-one error found
diff --git a/test/files/neg/macro-bundle-mixbox.scala b/test/files/neg/macro-bundle-mixbox.scala
deleted file mode 100644
index 17120aaf07..0000000000
--- a/test/files/neg/macro-bundle-mixbox.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-import scala.language.experimental.macros
-import scala.reflect.macros.blackbox.{Macro => BlackboxMacro}
-import scala.reflect.macros.whitebox.{Macro => WhiteboxMacro}
-
-trait Bundle extends BlackboxMacro with WhiteboxMacro {
- def impl = ???
-}
-
-object Macros {
- def foo = macro Bundle.impl
-} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-noncontext.check b/test/files/neg/macro-bundle-noncontext.check
new file mode 100644
index 0000000000..bb5d0851f5
--- /dev/null
+++ b/test/files/neg/macro-bundle-noncontext.check
@@ -0,0 +1,4 @@
+macro-bundle-noncontext.scala:8: error: not found: value Bundle
+ def foo = Bundle.impl
+ ^
+one error found
diff --git a/test/files/neg/macro-bundle-nonmacro.scala b/test/files/neg/macro-bundle-noncontext.scala
index c7d99f4582..c228827e70 100644
--- a/test/files/neg/macro-bundle-nonmacro.scala
+++ b/test/files/neg/macro-bundle-noncontext.scala
@@ -1,6 +1,6 @@
import scala.language.experimental.macros
-trait Bundle {
+class Bundle {
def impl = ???
}
diff --git a/test/files/neg/macro-bundle-nonmacro.check b/test/files/neg/macro-bundle-nonmacro.check
deleted file mode 100644
index 5a265b5724..0000000000
--- a/test/files/neg/macro-bundle-nonmacro.check
+++ /dev/null
@@ -1,4 +0,0 @@
-macro-bundle-nonmacro.scala:8: error: not found: value Bundle
- def foo = Bundle.impl
- ^
-one error found
diff --git a/test/files/neg/macro-bundle-object.scala b/test/files/neg/macro-bundle-object.scala
index 02278e7165..6e1eec1686 100644
--- a/test/files/neg/macro-bundle-object.scala
+++ b/test/files/neg/macro-bundle-object.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.blackbox._
+import scala.reflect.macros.blackbox.Context
-object Bundle extends Macro {
+object Bundle {
val c: Context = ???
def impl = ???
}
diff --git a/test/files/neg/macro-bundle-polymorphic.check b/test/files/neg/macro-bundle-polymorphic.check
deleted file mode 100644
index 8eedce7e87..0000000000
--- a/test/files/neg/macro-bundle-polymorphic.check
+++ /dev/null
@@ -1,10 +0,0 @@
-macro-bundle-polymorphic.scala:9: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
- def foo = macro Bundle.impl
- ^
-macro-bundle-polymorphic.scala:10: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
- def foo = macro Bundle[Int].impl
- ^
-macro-bundle-polymorphic.scala:11: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
- def foo = macro Bundle[Int, Nothing].impl
- ^
-three errors found
diff --git a/test/files/neg/macro-bundle-polymorphic.scala b/test/files/neg/macro-bundle-polymorphic.scala
deleted file mode 100644
index b636b6bd6a..0000000000
--- a/test/files/neg/macro-bundle-polymorphic.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-import scala.language.experimental.macros
-import scala.reflect.macros.blackbox.Macro
-
-trait Bundle[T] extends Macro {
- def impl = ???
-}
-
-object Macros {
- def foo = macro Bundle.impl
- def foo = macro Bundle[Int].impl
- def foo = macro Bundle[Int, Nothing].impl
-} \ No newline at end of file
diff --git a/test/files/neg/macro-bundle-trait.check b/test/files/neg/macro-bundle-trait.check
index d7363fc361..869c67e1e3 100644
--- a/test/files/neg/macro-bundle-trait.check
+++ b/test/files/neg/macro-bundle-trait.check
@@ -1,4 +1,4 @@
-macro-bundle-trait.scala:10: error: macro bundles must be monomorphic traits extending either blackbox.Macro or whitebox.Macro and not implementing their `val c: Context` member
+macro-bundle-trait.scala:10: error: not found: value Bundle
def foo = macro Bundle.impl
^
one error found
diff --git a/test/files/neg/macro-bundle-trait.scala b/test/files/neg/macro-bundle-trait.scala
index 0d01459f7e..2aa63216f5 100644
--- a/test/files/neg/macro-bundle-trait.scala
+++ b/test/files/neg/macro-bundle-trait.scala
@@ -1,7 +1,7 @@
import scala.language.experimental.macros
-import scala.reflect.macros.blackbox._
+import scala.reflect.macros.blackbox.Context
-trait Bundle extends Macro {
+trait Bundle {
val c: Context = ???
def impl = ???
}
diff --git a/test/files/neg/macro-quasiquotes/Macros_1.scala b/test/files/neg/macro-quasiquotes/Macros_1.scala
index 7bfdbaeef9..b123c475c2 100644
--- a/test/files/neg/macro-quasiquotes/Macros_1.scala
+++ b/test/files/neg/macro-quasiquotes/Macros_1.scala
@@ -1,7 +1,7 @@
import language.experimental.macros
-import scala.reflect.macros.blackbox.Macro
+import scala.reflect.macros.blackbox.Context
-trait Impls extends Macro {
+class Impls(val c: Context) {
import c.universe._
def impl1(x: Expr[Int]) = q"println(x)"
def impl2(x: Tree) = q"println(x)"