diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-11-22 01:12:45 -0800 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-11-22 01:12:45 -0800 |
commit | b24cac12f546b767233351e8d2aa19ddb51debeb (patch) | |
tree | dde17f26e508069b6953fe59e80078a918fd4956 /test | |
parent | d76b44fc9ede471b86a8ccfe007b8195c811caaa (diff) | |
parent | 5eef542ae4d425940cc5059e68cb238c56e601a7 (diff) | |
download | scala-b24cac12f546b767233351e8d2aa19ddb51debeb.tar.gz scala-b24cac12f546b767233351e8d2aa19ddb51debeb.tar.bz2 scala-b24cac12f546b767233351e8d2aa19ddb51debeb.zip |
Merge pull request #3172 from retronym/ticket/7987
SI-7987 Test case for "macro not expanded" error with 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 + () + } +} |