Coverage misses expression with `-Yexplicit-nulls` and `.nn`
Opened this issue · 3 comments
mohe2015 commented
Compiler version
3.4.2 and 3.5.0-RC1, so probably all
Minimized code
With -Yexplicit-nulls
and coverage enabled (project available at https://github.com/mohe2015/scala3-broken-coverage-explicit-nulls)
@main def hello(): Unit =
println("Hello world!".nn)
Output
The expression is not marked as covered:
Expectation
All code is covered.
mohe2015 commented
Probably has something to do with inline def
in general. Maybe it would make sense to have some annotation to influence this.
mohe2015 commented
Related case is probably
@main def hello(): Unit =
try {
assert(true, 1 / 0)
assert(false, 1 / 1)
} catch {
case assertionError: AssertionError => assertionError.printStackTrace()
}
where I would argue the 1 / 0
should not be covered at all (white) because as the assertion is true it is not executed but I also think it wouldn't make sense that assertion error messages create missing coverage by default.
mohe2015 commented