Permalink
Browse files

SI-7987 Test case for "macro not expanded" error with implicits

Fixed, serendipitously, a handful of commits ago in 4a6882e,
"SI-7944 FOUND: stray undetermined type params in vicinity of
implicits".
  • Loading branch information...
1 parent c243435 commit 5eef542ae4d425940cc5059e68cb238c56e601a7 @retronym retronym committed Nov 21, 2013
Showing with 18 additions and 0 deletions.
  1. +6 −0 test/files/pos/t7987/Macro_1.scala
  2. +12 −0 test/files/pos/t7987/Test_2.scala
@@ -0,0 +1,6 @@
+import scala.language.experimental._
+
+object Macro {
+ def apply[A](a: A): A = macro impl[A]
+ def impl[A](c: reflect.macros.Context)(a: c.Expr[A]): c.Expr[A] = a
+}
@@ -0,0 +1,12 @@
+class C[T] {
+ def foo = 0
+}
+
+object Test {
+ implicit def AnyToC[T](a: Any): C[T] = new C[T]
+ // was: "macro not expanded"
+ Macro {
+ "".foo
+ ()
+ }
+}

0 comments on commit 5eef542

Please sign in to comment.