diff options
Diffstat (limited to 'tests/disabled/macro/run/toolbox_console_reporter.scala')
-rw-r--r-- | tests/disabled/macro/run/toolbox_console_reporter.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/toolbox_console_reporter.scala b/tests/disabled/macro/run/toolbox_console_reporter.scala new file mode 100644 index 000000000..53cbcb0fb --- /dev/null +++ b/tests/disabled/macro/run/toolbox_console_reporter.scala @@ -0,0 +1,28 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.{ToolBox, mkConsoleFrontEnd} + +object Test extends dotty.runtime.LegacyApp { + //val oldErr = Console.err; + val baos = new java.io.ByteArrayOutputStream() + val errs = new java.io.PrintStream(baos) + (Console withErr errs) { + val toolbox = cm.mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation") + toolbox.eval(reify{ + object Utils { + @deprecated("test", "2.10.0") + def foo: Unit = { println("hello") } + } + + Utils.foo + }.tree) + println("============compiler console=============") + errs.flush() + println(baos.toString); + println("=========================================") + println("============compiler messages============") + toolbox.frontEnd.infos.foreach(println(_)) + println("=========================================") + } +} |