-
Notifications
You must be signed in to change notification settings - Fork 22
toolboxes don't reset reporters after parser errors #5942
Copy link
Copy link
Closed
Description
ToolBox potentially has a bug in the implementation of parseExpr. A call with a string containing a syntax error, produces a ToolBoxError. A subsequent call with a string containing correct code results in the same error:
scala> val tb = m.mkToolBox()
tb: scala.tools.reflect.ToolBox[reflect.runtime.universe.type] = scala.tools.reflect.ToolBoxFactory$ToolBoxImpl@1f521f12
scala> tb.parseExpr("def x = {}") // works fine
res34: tb.u.Tree = def x = ()
scala> tb.parseExpr("def x = {")
scala.tools.reflect.ToolBoxError: reflective compilation has failed:
'}' expected but eof found.
<strack-trace>
scala> tb.parseExpr("def x = {}") // doesn't work any more
scala.tools.reflect.ToolBoxError: reflective compilation has failed:
'}' expected but eof found.
<strack-trace> Reactions are currently unavailable