File tree 2 files changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/transform
tests/pos-with-compiler-cc/dotc/transform
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,8 @@ class InstrumentCoverage extends MacroTransform with IdentityDenotTransformer:
237
237
val InstrumentedParts (pre, coverageCall, expr) = tryInstrument(fun)
238
238
239
239
if coverageCall.isEmpty then
240
- // `fun` cannot be instrumented, and `args` is a type so we keep this tree as it is
241
- tree
240
+ // `fun` cannot be instrumented, and `args` is a type but the expr may have been transformed
241
+ cpy. TypeApply ( tree)(expr, args)
242
242
else
243
243
// expr[T] shouldn't be transformed to:
244
244
// {invoked(...), expr}[T]
@@ -330,7 +330,7 @@ class InstrumentCoverage extends MacroTransform with IdentityDenotTransformer:
330
330
tree.rhs
331
331
else if sym.isClassConstructor then
332
332
instrumentSecondaryCtor(tree)
333
- else if ! sym.isOneOf(Accessor | Artifact | Synthetic ) then
333
+ else if ! sym.isOneOf(Accessor ) then
334
334
// If the body can be instrumented, do it (i.e. insert a "coverage call" at the beginning)
335
335
// This is useful because methods can be stored and called later, or called by reflection,
336
336
// and if the rhs is too simple to be instrumented (like `def f = this`),
Original file line number Diff line number Diff line change @@ -236,8 +236,8 @@ class InstrumentCoverage extends MacroTransform with IdentityDenotTransformer:
236
236
val InstrumentedParts (pre, coverageCall, expr) = tryInstrument(fun)
237
237
238
238
if coverageCall.isEmpty then
239
- // `fun` cannot be instrumented, and `args` is a type so we keep this tree as it is
240
- tree
239
+ // `fun` cannot be instrumented, and `args` is a type but the expr may have been transformed
240
+ cpy. TypeApply ( tree)(expr, args)
241
241
else
242
242
// expr[T] shouldn't be transformed to:
243
243
// {invoked(...), expr}[T]
You can’t perform that action at this time.
0 commit comments