@@ -343,8 +343,11 @@ object Interactive {
343
343
syms.foreach { case (sym, name, rename) =>
344
344
val tree = tpd.Select (imp.expr, sym.name).withPos(name.pos)
345
345
val renameTree = rename.map { r =>
346
+ // Get the type of the symbol that is actually selected, and construct a select
347
+ // node with the new name and the type of the real symbol.
346
348
val name = if (sym.name.isTypeName) r.name.toTypeName else r.name
347
- RenameTree (name, tpd.Select (imp.expr, sym.name)).withPos(r.pos)
349
+ val actual = tpd.Select (imp.expr, sym.name)
350
+ tpd.Select (imp.expr, name).withPos(r.pos).withType(actual.tpe)
348
351
}
349
352
renameTree.foreach(traverse)
350
353
traverse(tree)
@@ -556,16 +559,6 @@ object Interactive {
556
559
lookup(name.sourceModuleName))
557
560
}
558
561
559
- /**
560
- * Used to represent a renaming import `{foo => bar}`.
561
- * We need this because the name of the tree must be the new name, but the
562
- * denotation must be that of the importee.
563
- */
564
- private case class RenameTree (name : Name , underlying : Tree ) extends NameTree {
565
- override def denot (implicit ctx : Context ) = underlying.denot
566
- myTpe = NoType
567
- }
568
-
569
562
/**
570
563
* Is this tree using a renaming introduced by an import statement?
571
564
*
0 commit comments