@@ -378,7 +378,7 @@ object PatternMatcher {
378
378
}
379
379
}
380
380
381
- /** Reference counts for all variables and labels */
381
+ /** Reference counts for all labels */
382
382
private def labelRefCount (plan : Plan ): collection.Map [Symbol , Int ] = {
383
383
object refCounter extends RefCounter {
384
384
override def apply (plan : LabelledPlan ): Plan = {
@@ -395,7 +395,7 @@ object PatternMatcher {
395
395
refCounter.count
396
396
}
397
397
398
- /** Reference counts for all variables and labels */
398
+ /** Reference counts for all variables */
399
399
private def varRefCount (plan : Plan ): collection.Map [Symbol , Int ] = {
400
400
object refCounter extends RefCounter {
401
401
override val treeMap = new TreeMap {
@@ -589,7 +589,8 @@ object PatternMatcher {
589
589
(new Inliner )(plan)
590
590
}
591
591
592
- /** Merge variables that have the same right hand side
592
+ /** Merge variables that have the same right hand side.
593
+ * Propagate common variable bindings as parameters into case labels.
593
594
*/
594
595
private def mergeVars (plan : Plan ): Plan = {
595
596
class RHS (val tree : Tree ) {
@@ -673,9 +674,8 @@ object PatternMatcher {
673
674
(new Merge (Map ()))(plan)
674
675
}
675
676
676
- /** Inline let-bound trees and labelled blocks that are referenced only once.
677
- * Drop all variables and labels that are not referenced anymore after this.
678
- * Also: hoist cases out of tests using `hoistLabelled`.
677
+ /** Inline let-bound trees that are referenced only once.
678
+ * Drop all variables that are not referenced anymore after this.
679
679
*/
680
680
private def inlineVars (plan : Plan ): Plan = {
681
681
val refCount = varRefCount(plan)
0 commit comments