Skip to content

Coverage generated for inlined Predef function #15791

Closed
@Martomate

Description

@Martomate

Compiler version

3.2.0-RC3

Minimized code

@main def a(b: Int): Unit = {
  assert(b == 1)
}

The assert function is part of the Scala 3 library at scala.runtime.stdLibPatches.Predef and has this definition:

transparent inline def assert(inline assertion: Boolean): Unit =
  if !assertion then scala.runtime.Scala3RunTime.assertFailed()

Output

scoverage.coverage contains entries for library/src/scala/runtime/stdLibPatches/Predef.scala.

As a result sbt coverageReport fails with the following error:

No source root found for '/Users/martin/git/myproject/library/src/scala/runtime/stdLibPatches/Predef.scala' (source roots: '/Users/martin/git/myproject/src/main/scala/')

Expectation

No coverage entries should be generated for the Predef file, just like all other files in the Scala library.

This issue seems to be related to #15490.

Metadata

Metadata

Labels

area:coverageCode coverage, see https://dotty.epfl.ch/docs/internals/coverage.htmlitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions