Skip to content

Commit ab6350b

Browse files
committed
Supports case clauses
1 parent 29183f1 commit ab6350b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/scales/plugin.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ScalesComponent(val global: Global)
5656

5757
// instrument the given case defintions not changing the patterns or guards
5858
def transformCases(cases: List[CaseDef]): List[CaseDef] = {
59-
cases.map(c => treeCopy.CaseDef(c, c.pat, c.guard, instrument(instrument(c.body), true)))
59+
cases.map(c => treeCopy.CaseDef(c, c.pat, process(c.guard), instrument(process(c.body), true)))
6060
}
6161

6262
def transformIf(tree: Tree) = {
@@ -196,7 +196,7 @@ class ScalesComponent(val global: Global)
196196

197197
// pattern match clauses will be instrumented per case
198198
case Match(clause: Tree, cases: List[CaseDef]) =>
199-
treeCopy.Match(tree, clause, transformCases(cases))
199+
treeCopy.Match(tree, instrument(clause), transformCases(cases))
200200

201201
// a synthetic object is a generated object, such as case class companion
202202
case m: ModuleDef if m.symbol.isSynthetic => tree

0 commit comments

Comments
 (0)