Skip to content

Commit 88e348b

Browse files
committed
Instrument finally section only if it is present.
It wasn't instrumented before when it was missing, but `Could not instrument [EmptyTree$/null]. No pos.` warning was emitted. Now `instrument` method will be called only if `finnaly` section is present.
1 parent 0ceef0c commit 88e348b

File tree

1 file changed

+1
-1
lines changed
  • scalac-scoverage-plugin/src/main/scala/scoverage

1 file changed

+1
-1
lines changed

scalac-scoverage-plugin/src/main/scala/scoverage/plugin.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ class ScoverageInstrumentationComponent(val global: Global, extraAfterPhase: Opt
570570
treeCopy.Try(tree,
571571
instrument(process(t), t, branch = true),
572572
transformCases(cases),
573-
instrument(process(f), f, branch = true))
573+
if (f.isEmpty) f else instrument(process(f), f, branch = true))
574574

575575
// type aliases, type parameters, abstract types
576576
case t: TypeDef => super.transform(tree)

0 commit comments

Comments
 (0)