aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'libraries')
-rw-r--r--libraries/eval/Eval.scala3
-rw-r--r--libraries/eval/test/EvalTest.scala12
2 files changed, 15 insertions, 0 deletions
diff --git a/libraries/eval/Eval.scala b/libraries/eval/Eval.scala
index abd1836..1ab5762 100644
--- a/libraries/eval/Eval.scala
+++ b/libraries/eval/Eval.scala
@@ -581,6 +581,9 @@ class Eval(target: Option[File]) {
if (Debug.enabled)
Debug.printWithLineNumbers(code)
+ //reset reporter, or will always throw exception after one error while resetState==false
+ resetReporter()
+
// if you're looking for the performance hit, it's 1/2 this line...
val compiler = new global.Run
val sourceFiles = List(new BatchSourceFile("(inline)", code))
diff --git a/libraries/eval/test/EvalTest.scala b/libraries/eval/test/EvalTest.scala
index 8b986e2..d445424 100644
--- a/libraries/eval/test/EvalTest.scala
+++ b/libraries/eval/test/EvalTest.scala
@@ -217,6 +217,18 @@ class EvalTest extends WordSpec {
assert(eval.errors.isEmpty)
}
+ "reset reporter between inPlace invocations" in {
+ val ctx = new Ctx
+ import ctx._
+
+ intercept[Throwable] {
+ eval.inPlace[Int]("val a = 3; val b = q; a + b")
+ }
+ assert(eval.errors.nonEmpty)
+ assert(eval.inPlace[Int]("val d = 3; val e = 2; d + e") == 5)
+ assert(eval.errors.isEmpty)
+ }
+
"reporter should be reset between checks, but loaded class should remain" in {
val ctx = new Ctx
import ctx._