Skip to content

Commit

Permalink
Fix match error in DelegatingReporter.scala
Browse files Browse the repository at this point in the history
8b2db7a introduced a regression because
it is not always the case that the source passed in to
DelegateReporter.makePosition is an instance of AbstractZincFile.
53bc41a partially fixed this by
handling PlainFile but the proper fix is to handle AbstractFile which is
what was done prior to 8b2db7a

This was detected by running the community build in the shapeless
project.
  • Loading branch information
eatkins committed Sep 3, 2020
1 parent af95bf2 commit a05e58a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import java.util.Optional
import scala.reflect.internal.util.{ FakePos, NoPosition, Position }
// Left for compatibility
import Compat._
import scala.reflect.io.PlainFile
import scala.reflect.io.AbstractFile

private object DelegatingReporter {
def apply(settings: scala.tools.nsc.Settings, delegate: xsbti.Reporter): DelegatingReporter =
Expand Down Expand Up @@ -92,7 +92,7 @@ private object DelegatingReporter {
val src = pos.source
val sourcePath = src.file match {
case AbstractZincFile(virtualFile) => virtualFile.id
case f: PlainFile => f.file.toString
case af: AbstractFile => af.path
}
val sourceFile = new File(src.file.path)
val line = pos.line
Expand Down

0 comments on commit a05e58a

Please sign in to comment.