Looking through the Runtime.scala code you will find under doParse and the unparse methods a case statement for when ProcessingErrors are caught.
Within this statement we do:
This seems unnecessary as the ProcessingError is already an object. The toParseError or toUnparseError call on the existing ProcessingError object creates yet another object which is then added to the diagnostics list. This seems wasteful as we're creating a new object for each existing ProcessError object.
Also, is there a need to make a distinction between ProcessingErrors being either Parse or Unparse errors? Shouldn't we know that just by the fact that we 'got diagnostics' from the Parser or Unparser?