scala/scala3

Coverage misses generic `given` with `"-language:strictEquality"` and `CanEqual.derived`

Opened this issue · 0 comments

Compiler version

3.4.2 and 3.5.0-RC1, so probably all

Minimized code

With -language:strictEquality and coverage enabled (project available at https://github.com/mohe2015/scala3-broken-coverage-explicit-nulls/tree/coverage-canequal, note the non-default branch)

case class Test[T](value: T)

given canEqual[T]: CanEqual[Test[T], Test[T]] = CanEqual.derived

@main def hello(): Unit =
  print(Test(1) == Test(1))

Output

The given is not marked as covered.

image

Note: It is not marked red when replacing the generic T by some concrete type.

Expectation

The given should either be marked not at all or in green as covered.