Skip to content
This repository
Browse code

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...
commit 5eef542ae4d425940cc5059e68cb238c56e601a7 1 parent c243435
Jason Zaugg retronym authored
6 test/files/pos/t7987/Macro_1.scala
... ... @@ -0,0 +1,6 @@
  1 +import scala.language.experimental._
  2 +
  3 +object Macro {
  4 + def apply[A](a: A): A = macro impl[A]
  5 + def impl[A](c: reflect.macros.Context)(a: c.Expr[A]): c.Expr[A] = a
  6 +}
12 test/files/pos/t7987/Test_2.scala
... ... @@ -0,0 +1,12 @@
  1 +class C[T] {
  2 + def foo = 0
  3 +}
  4 +
  5 +object Test {
  6 + implicit def AnyToC[T](a: Any): C[T] = new C[T]
  7 + // was: "macro not expanded"
  8 + Macro {
  9 + "".foo
  10 + ()
  11 + }
  12 +}

0 comments on commit 5eef542

Please sign in to comment.
Something went wrong with that request. Please try again.