@@ -624,7 +624,7 @@ object Interactive {
624
624
625
625
/** Are the two names the same? */
626
626
def sameName (n0 : Name , n1 : Name ): Boolean = {
627
- n0.stripModuleClassSuffix.toString == n1.stripModuleClassSuffix.toString
627
+ n0.stripModuleClassSuffix.toTermName eq n1.stripModuleClassSuffix.toTermName
628
628
}
629
629
630
630
/**
@@ -640,13 +640,11 @@ object Interactive {
640
640
tree match {
641
641
case Import (_, selectors) =>
642
642
selectors.exists {
643
- case Thicket (_ :: Ident (rename) :: Nil ) =>
644
- rename.stripModuleClassSuffix.toString == toName.stripModuleClassSuffix.toString
645
- case _ =>
646
- false
643
+ case Thicket (_ :: Ident (rename) :: Nil ) => sameName(rename, toName)
644
+ case _ => false
647
645
}
648
- case _ =>
649
- false
646
+ case _ =>
647
+ false
650
648
}
651
649
}
652
650
@@ -696,7 +694,7 @@ object Interactive {
696
694
case pkg : PackageDef if immediatelyEnclosesRenaming(toName, pkg) =>
697
695
EmptyTree
698
696
case template : Template if immediatelyEnclosesRenaming(toName, template) =>
699
- cpy.Template (template)(constr = DefDef (template.constr.symbol.asTerm), self = template.self, body = Nil )
697
+ cpy.Template (template)(constr = DefDef (template.constr.symbol.asTerm), body = Nil )
700
698
case block @ Block (stats, expr) if immediatelyEnclosesRenaming(toName, block) =>
701
699
EmptyTree
702
700
case other =>
@@ -706,7 +704,7 @@ object Interactive {
706
704
}
707
705
708
706
val trees = {
709
- val trees = enclosing match {
707
+ val enclosedTrees = enclosing match {
710
708
case Some (pkg : PackageDef ) =>
711
709
pkg.stats
712
710
case Some (template : Template ) =>
@@ -720,7 +718,7 @@ object Interactive {
720
718
721
719
// These trees may contain a new renaming of the same symbol to the same name, so we may
722
720
// have to cut some branches
723
- val trimmedTrees = trees .map(removeBlockWithRenaming(toName, _))
721
+ val trimmedTrees = enclosedTrees .map(removeBlockWithRenaming(toName, _))
724
722
725
723
// Some of these trees may not be `NameTrees`. Those that are not are wrapped in a
726
724
// synthetic val def, so that everything can go inside `SourceNamedTree`s.
0 commit comments