-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the issue with coverage inside of a TypeApply (#18420)
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 the `coverage` file contained references to things that could never be invoked.
- Loading branch information
Showing
6 changed files
with
184 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
List(List(1), List(2), List(3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
6 | ||
1 | ||
3 | ||
2 | ||
5 | ||
4 | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@main | ||
def Test: Unit = | ||
// verifies a problematic case where the TypeApply instrumentation was added to the coverage file, | ||
// but was never marked as invoked | ||
println(List(1,2,3).map(a => List(a))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
# Coverage data, format version: 3.0 | ||
# Statement data: | ||
# - id | ||
# - source path | ||
# - package name | ||
# - class name | ||
# - class type (Class, Object or Trait) | ||
# - full class name | ||
# - method name | ||
# - start offset | ||
# - end offset | ||
# - line number | ||
# - symbol name | ||
# - tree name | ||
# - is branch | ||
# - invocations count | ||
# - is ignored | ||
# - description (can be multi-line) | ||
# '' sign | ||
# ------------------------------------------ | ||
0 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
Test | ||
163 | ||
201 | ||
4 | ||
println | ||
Apply | ||
false | ||
0 | ||
false | ||
println(List(1,2,3).map(a => List(a))) | ||
|
||
1 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
Test | ||
171 | ||
200 | ||
4 | ||
map | ||
Apply | ||
false | ||
0 | ||
false | ||
List(1,2,3).map(a => List(a)) | ||
|
||
2 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
Test | ||
171 | ||
182 | ||
4 | ||
apply | ||
Apply | ||
false | ||
0 | ||
false | ||
List(1,2,3) | ||
|
||
3 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
Test | ||
171 | ||
175 | ||
4 | ||
List | ||
Ident | ||
false | ||
0 | ||
false | ||
List | ||
|
||
4 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
$anonfun | ||
192 | ||
199 | ||
4 | ||
apply | ||
Apply | ||
false | ||
0 | ||
false | ||
List(a) | ||
|
||
5 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
$anonfun | ||
192 | ||
196 | ||
4 | ||
List | ||
Ident | ||
false | ||
0 | ||
false | ||
List | ||
|
||
6 | ||
type-apply/test.scala | ||
<empty> | ||
test$package$ | ||
Object | ||
<empty>.test$package$ | ||
Test | ||
0 | ||
14 | ||
1 | ||
Test | ||
DefDef | ||
false | ||
0 | ||
false | ||
@main\ndef Test | ||
|