Skip to content

Commit 627ca6d

Browse files
Align coverage negative test handling
1 parent 63de688 commit 627ca6d

4 files changed

Lines changed: 5 additions & 34 deletions

File tree

compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,11 @@ object LiftCoverage extends LiftImpure:
191191
def markSelectedReceiverApply(tree: tpd.Apply)(using Context): Unit =
192192
tree.putAttachment(SelectedReceiverApply, tree)
193193

194-
override protected def onLiftedDef(tree: tpd.Tree)(using Context): Unit =
195-
tree.putAttachment(CoverageLiftedTemp, liftingArgs)
196-
197194
/** Keep RHS-local symbols unchanged: coverage moves them only under a weak owner. */
198195
override protected def liftedDef(sym: TermSymbol, rhs: tpd.Tree)(using Context): tpd.MemberDef =
199196
val rhs1 = ctx.property(PreservedArgType).fold(rhs)(rhs.ensureConforms)
200197
tpd.ValDef(sym, rhs1, inferred = true)
198+
.withAttachment(CoverageLiftedTemp, liftingArgs)
201199

202200
override protected def liftedRef(lifted: TermSymbol, liftedType: Type, expr: tpd.Tree)(using Context): tpd.Tree =
203201
val liftedRef = tpd.ref(lifted.termRef)

compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ abstract class Lifter {
5555
val tp = expr.tpe.deskolemized
5656
if tp.isStable then tp else tp.widen
5757

58-
/** Hook for lifters that need to record or mark freshly created lifted defs. */
59-
protected def onLiftedDef(tree: Tree)(using Context): Unit = ()
60-
6158
protected def liftedRef(lifted: TermSymbol, liftedType: Type, expr: Tree)(using Context): Tree =
6259
ref(lifted.termRef)
6360

@@ -73,7 +70,6 @@ abstract class Lifter {
7370
// at a higher nesting level to prevent leaks. See tests/pos/i15174.scala
7471
nestingLevel = ctx.nestingLevel + 1)
7572
val liftedTree = liftedDef(lifted, expr).withSpan(expr.span).setDefTree
76-
onLiftedDef(liftedTree)
7773
defs += liftedTree
7874
liftedRef(lifted, liftedType, expr).withSpan(expr.span.focus)
7975
}

compiler/test/dotc/scoverage-ignore.excludelist

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,6 @@ traitParams.scala
1515
optimizer-warnings.scala
1616
i10174b.scala
1717
i17132.min.scala
18-
sepchecks2.scala
19-
i15474b.scala
20-
real-try.scala
21-
fresh-counter.scala
22-
capt-depfun2.scala
23-
lazylists-exceptions.scala
24-
i16725.scala
25-
splits-mutable.scala
26-
i19470.scala
27-
i11225.scala
28-
splits.scala
29-
sep-primer-examples.scala
30-
type-cast-purity.scala
31-
mut-iterator4.scala
32-
caseclass
33-
capt-depfun.scala
34-
i15772.scala
35-
sep-freeze-boxes.scala
36-
erasedValueb.scala
37-
lazylists2.scala
38-
i16114.scala
39-
check-inferred.scala
4018
i15158.scala
4119
recursive-lower-constraint.scala
4220
i21015.scala

tests/neg-custom-args/captures/freeze-boxes.check

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
21 | val xs: Box[Ref^{}] = freeze:
33
22 | Box(a) // error
44
| ^
5-
| Found: Box[Ref^{any.rd}]^{}
6-
| Required: Box[Ref^{}]^{any².rd}
5+
| Found: Box[Ref^{a.rd}]^{}
6+
| Required: Box[Ref^{}]^{any.rd}
77
|
8-
| Note that capability `any.rd` cannot flow into capture set {}.
8+
| Note that capability `a.rd` cannot flow into capture set {}.
99
|
10-
| where: any is a root capability classified as Unscoped in the type of value x$1
11-
| any² is a root capability classified as Unscoped in the type of value xs
10+
| where: any is a root capability classified as Unscoped in the type of value xs
1211
|
1312
| longer explanation available when compiling with `-explain`

0 commit comments

Comments
 (0)