From b1538804043bdd7036a6378a9146b685db03a4ba Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 23 Feb 2013 14:49:38 +0100 Subject: SI-7047 fixes silent for c.inferImplicitXXX This is a port of https://github.com/scala/scala/commit/b4da864247 from 2.10.x. --- test/files/run/t7047.check | 0 test/files/run/t7047/Impls_Macros_1.scala | 19 +++++++++++++++++++ test/files/run/t7047/Test_2.scala | 3 +++ 3 files changed, 22 insertions(+) create mode 100644 test/files/run/t7047.check create mode 100644 test/files/run/t7047/Impls_Macros_1.scala create mode 100644 test/files/run/t7047/Test_2.scala (limited to 'test') diff --git a/test/files/run/t7047.check b/test/files/run/t7047.check new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/files/run/t7047/Impls_Macros_1.scala b/test/files/run/t7047/Impls_Macros_1.scala new file mode 100644 index 0000000000..2992e3efe4 --- /dev/null +++ b/test/files/run/t7047/Impls_Macros_1.scala @@ -0,0 +1,19 @@ +import scala.reflect.macros.Context +import language.experimental.macros + +class Foo + +object Macros { + def impl(c: Context) = { + import c.universe._ + try { + c.inferImplicitValue(typeOf[Foo], silent = false) + c.abort(c.enclosingPosition, "silent=false is not working") + } catch { + case _: Exception => + } + c.literalNull + } + + def foo = macro impl +} \ No newline at end of file diff --git a/test/files/run/t7047/Test_2.scala b/test/files/run/t7047/Test_2.scala new file mode 100644 index 0000000000..acfddae942 --- /dev/null +++ b/test/files/run/t7047/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends App { + Macros.foo +} \ No newline at end of file -- cgit v1.2.3