Scala Programming Language
  1. Scala Programming Language
  2. SI-5942

toolboxes don't reset reporters after parser errors

    Details

      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> 
      

        Activity

        Show
        Eugene Burmako added a comment - http://groups.google.com/group/scala-user/browse_thread/thread/88e89d154e79826d
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/1328
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/commit/5e6d069b0078851dffb163b2a2db503eac31e54f

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Eugene Burmako
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development