diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-18 00:06:00 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-18 00:06:26 +0200 |
commit | 5e6d069b0078851dffb163b2a2db503eac31e54f (patch) | |
tree | b0e061d9bc324c1aaba2571aa7735108b2887bfa | |
parent | 66603a2c003852d39faec20a9763fb0e25049cf4 (diff) | |
download | scala-5e6d069b0078851dffb163b2a2db503eac31e54f.tar.gz scala-5e6d069b0078851dffb163b2a2db503eac31e54f.tar.bz2 scala-5e6d069b0078851dffb163b2a2db503eac31e54f.zip |
SI-5942 toolboxes now reset front ends
FrontEnd => Reporter proxy now correctly redirects
flush and reset back to the underlying front end.
-rw-r--r-- | src/compiler/scala/tools/reflect/FrontEnds.scala | 10 | ||||
-rw-r--r-- | test/files/run/t5942.check | 0 | ||||
-rw-r--r-- | test/files/run/t5942.scala | 10 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/reflect/FrontEnds.scala b/src/compiler/scala/tools/reflect/FrontEnds.scala index d8f07fb2e5..d0c3c1c774 100644 --- a/src/compiler/scala/tools/reflect/FrontEnds.scala +++ b/src/compiler/scala/tools/reflect/FrontEnds.scala @@ -36,6 +36,16 @@ trait FrontEnds extends scala.reflect.api.FrontEnds { def displayPrompt(): Unit = frontEnd.interactive() + + override def flush(): Unit = { + super.flush() + frontEnd.flush() + } + + override def reset(): Unit = { + super.reset() + frontEnd.reset() + } } def wrapFrontEnd(frontEnd: FrontEnd): Reporter = new FrontEndToReporterProxy(frontEnd) { diff --git a/test/files/run/t5942.check b/test/files/run/t5942.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/run/t5942.check diff --git a/test/files/run/t5942.scala b/test/files/run/t5942.scala new file mode 100644 index 0000000000..44a8be93f6 --- /dev/null +++ b/test/files/run/t5942.scala @@ -0,0 +1,10 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect._ + +object Test extends App { + val tb = cm.mkToolBox() + tb.parse("def x = {}") + try { tb.parse("def x = {") } catch { case _ => } + tb.parse("def x = {}") +} |