From 5eef542ae4d425940cc5059e68cb238c56e601a7 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 21 Nov 2013 09:13:11 +0100 Subject: SI-7987 Test case for "macro not expanded" error with implicits Fixed, serendipitously, a handful of commits ago in 4a6882e772, "SI-7944 FOUND: stray undetermined type params in vicinity of implicits". --- test/files/pos/t7987/Macro_1.scala | 6 ++++++ test/files/pos/t7987/Test_2.scala | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/files/pos/t7987/Macro_1.scala create mode 100644 test/files/pos/t7987/Test_2.scala diff --git a/test/files/pos/t7987/Macro_1.scala b/test/files/pos/t7987/Macro_1.scala new file mode 100644 index 0000000000..81f717b9c4 --- /dev/null +++ b/test/files/pos/t7987/Macro_1.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 +} diff --git a/test/files/pos/t7987/Test_2.scala b/test/files/pos/t7987/Test_2.scala new file mode 100644 index 0000000000..5896fdb517 --- /dev/null +++ b/test/files/pos/t7987/Test_2.scala @@ -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 + () + } +} -- cgit v1.2.3