Permalink
Browse files

neg test added

  • Loading branch information...
1 parent 597a949 commit 1be02447823f309c7450299ba7128da4b86573ad @martende martende committed Nov 27, 2012
@@ -0,0 +1,4 @@
+Test_2.scala:9: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
+ println(foo(42))
+ ^
+one error found
@@ -0,0 +1 @@
+-language:experimental.macros
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
+import scala.reflect.macros.{Context => Ctx}
+
+trait Impls {
+def impl(c: Ctx)(x: c.Expr[Any]) = x
+}
+
@@ -0,0 +1,11 @@
+import scala.reflect.macros.{Context => Ctx}
+
+object Macros extends Impls {
+ def foo(x: Any) = macro impl
+}
+
+object Test extends App {
+ import Macros._
+ println(foo(42))
+}
+

0 comments on commit 1be0244

Please sign in to comment.