diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-11-21 09:13:11 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-11-21 09:15:22 +0100 |
commit | 5eef542ae4d425940cc5059e68cb238c56e601a7 (patch) | |
tree | 47a847421d8fd615e40142cb71e2ec050f21a3e6 /test | |
parent | c243435f113615b2f7407fbd683c93ec16c73749 (diff) | |
download | scala-5eef542ae4d425940cc5059e68cb238c56e601a7.tar.gz scala-5eef542ae4d425940cc5059e68cb238c56e601a7.tar.bz2 scala-5eef542ae4d425940cc5059e68cb238c56e601a7.zip |
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".
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t7987/Macro_1.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t7987/Test_2.scala | 12 |
2 files changed, 18 insertions, 0 deletions
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 + () + } +} |