-
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
Fix the issue with coverage inside of a TypeApply #18420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, looks good to me.
Could you please 1. add a test in tests/coverage/pos
demonstrating the fix, and 2. rebase your commits into a single one?
compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala
Outdated
Show resolved
Hide resolved
tests/pos-with-compiler-cc/dotc/transform/InstrumentCoverage.scala
Outdated
Show resolved
Hide resolved
f5b07bb
to
afb2160
Compare
@mbovel I've made the changes you suggested. It seems that it was a bit more involved than adding a test into So i've added the ability for any of the This is optional behaviour for now. |
@@ -61,6 +61,26 @@ class CoverageTests: | |||
val instructions = FileDiff.diffMessage(expectFile.toString, targetFile.toString) | |||
fail(s"Coverage report differs from expected data.\n$instructions") | |||
|
|||
// measurement files only exist in the "run" category |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This verifies the measurement file against the check file (if a measurement check file exists).
Mainly so that none of the other tests need tweaking
afb2160
to
6338a06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me.
Added one small nitpick.
tests/pos-with-compiler-cc/dotc/transform/InstrumentCoverage.scala
Outdated
Show resolved
Hide resolved
… with a TypeApply Add the ability to verify measured coverage invocations in CoverageTests
6338a06
to
e5b3d4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
thanks for the fix! |
Based on looking into the issues that: #17239 was trying to solve.
It was discovered that
TypeApply
was throwing away parts of the expression tree, which meant that thecoverage
file contained references to things that could never be invoked.Note that i'm not too familiar with opening pull requests in github, so my apologies if this is not correct