Permalink
Browse files

diagnostics for SI-5692

  • Loading branch information...
1 parent 5cf9499 commit b242637ee1fc6db79992a67073219ec87150d06a @xeno-by xeno-by committed Apr 25, 2012
@@ -62,9 +62,16 @@ abstract class Pickler extends SubComponent {
// when we pickle it: so let's report an error instead. We know next
// to nothing about what happened, but our supposition is a lot better
// than "bad type: <error>" in terms of explanatory power.
- for (t <- unit.body ; if t.isErroneous) {
- unit.error(t.pos, "erroneous or inaccessible type")
- return
+ for (t <- unit.body) {
+ if (t.isErroneous) {
+ unit.error(t.pos, "erroneous or inaccessible type")
+ return
+ }
+
+ if (!t.isDef && t.hasSymbol && t.symbol.isTermMacro) {
+ unit.error(t.pos, "macro has not been expanded")
+ return
+ }
}
pickle(unit.body)
@@ -0,0 +1 @@
+-language:experimental.macros
@@ -0,0 +1,9 @@
+import scala.reflect.makro.Context
+
+object Impls {
+ def impl[A](c: reflect.makro.Context) = c.reify(())
+}
+
+object Macros {
+ def decl[A] = macro Impls.impl[A]
+}
@@ -0,0 +1,4 @@
+object Test extends App {
+ val x = Macros.decl
+ def y() { Macros.decl(); }
+}

0 comments on commit b242637

Please sign in to comment.