File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,10 @@ class ScoverageInstrumentationComponent(val global: Global)
437
437
438
438
// pattern match clauses will be instrumented per case
439
439
case m@ Match (clause : Tree , cases : List [CaseDef ]) =>
440
- if (m.selector.tpe.annotations.mkString == " unchecked" )
440
+ // we can be fairly sure this was generated as part of a for loop
441
+ if (m.selector.toString().contains(" check$" )
442
+ && m.selector.tpe.annotations.mkString == " unchecked"
443
+ && m.cases.last.toString == " case _ => false" ) // todo check these assumptions for 2.11
441
444
treeCopy.Match (tree, instrument(clause), transformCases(cases.dropRight(1 )) ++ cases.takeRight(1 ))
442
445
else
443
446
treeCopy.Match (tree, instrument(clause), transformCases(cases))
You can’t perform that action at this time.
0 commit comments