Closed
Description
Compiler version
3.2.0-RC1-bin-20220517-e5abec0-NIGHTLY
Minimized code
Let's create a file GoodCoverage.scala:
object GoodCoverage {
def sum(num1: Int, num2: Int) = {
if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2
}
}
then let's try to compile it using java 1.8 runtime (I've used jenv for that) and set the coverage flag:
~/dotty/dist/target/pack/bin/scalac -coverage-out:scoverage.coverage GoodCoverage.scala
Output
The generated coverage file contains wrong paths to sources:
../GoodCoverage.scala
The ..
part is wrong because this file is present in the cwd.
Expectation
The path should be the same as when using java 11+ runtime:
GoodCoverage.scala
This issue is blocking addition of support for Scala 3 in sbt-scoverage: scoverage/sbt-scoverage#429