-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler produces incorrect/incomplete coverage data #16634
Labels
area:coverage
Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html
itype:bug
stat:needs spec
Comments
rolandtritsch
added
itype:bug
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Jan 8, 2023
mbovel
added
area:coverage
Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Jan 9, 2023
Kordyjan
added
stat:needs spec
and removed
stat:needs minimization
Needs a self contained minimization
labels
Jan 13, 2023
Likely related to scoverage/sbt-scoverage#382 as well as scoverage/sbt-scoverage#458 |
vijaykramesh#1 demonstrates the issue pretty clearly by adding an additional coverage test |
KacperFKorban
referenced
this issue
in dotty-staging/dotty
Aug 22, 2023
…nthetic spans Marking bodies of CaseDefs as branches seems like an uncontroversial change, it was probably an oversight. Not ignoring synthetic spans when creating coverage calls in branches seems like a good trade off. There might be some auto-generated `else ()` interpreted as branches, but Scala introduces quite a lot of synthetic trees that wrap non-synthetic trees (e.g. implicit classes). Also, it looks like Scala 2 includes those compiler-generated `else` branches in coverage. (Another possibility here would be to also check if the span is zero extent, but that approach would be different to the Scala 2 one) partial fix for lampepfl#16634
sjrd
added a commit
that referenced
this issue
Aug 22, 2023
…nthetic spans (#18437) Marking bodies of CaseDefs as branches seems like an uncontroversial change, it was probably an oversight. Not ignoring synthetic spans when creating coverage calls in branches seems like a good trade off. There might be some auto-generated `else ()` interpreted as branches, but Scala introduces quite a lot of synthetic trees that wrap non-synthetic trees (e.g. implicit classes). Also, it looks like Scala 2 includes those compiler-generated `else` branches in coverage. (Another possibility here would be to also check if the span is zero extent, but that approach would be different to the Scala 2 one) partial fix for #16634
Closing this issue now. It has been addressed in: |
Kordyjan
referenced
this issue
Dec 11, 2023
…nthetic spans Marking bodies of CaseDefs as branches seems like an uncontroversial change, it was probably an oversight. Not ignoring synthetic spans when creating coverage calls in branches seems like a good trade off. There might be some auto-generated `else ()` interpreted as branches, but Scala introduces quite a lot of synthetic trees that wrap non-synthetic trees (e.g. implicit classes). Also, it looks like Scala 2 includes those compiler-generated `else` branches in coverage. (Another possibility here would be to also check if the span is zero extent, but that approach would be different to the Scala 2 one) partial fix for lampepfl#16634 [Cherry-picked bcb2053]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:coverage
Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html
itype:bug
stat:needs spec
See also - scoverage/sbt-scoverage-samples#28
Compiler version
3.2.2-RC2
Minimised code
See issue above.
To reproduce run
sbt +clean +coverage +test +coverageReport
onsbt-scoverage-samples
.Output
See issue above. Output for scala3 is incorrect.
Expectation
Generated scala3
scoverage.coverage
data should (roughly) equal the scala2 coverage data.Next step(s)
The text was updated successfully, but these errors were encountered: