@@ -343,8 +343,11 @@ object Interactive {
343343 syms.foreach { case (sym, name, rename) =>
344344 val tree = tpd.Select (imp.expr, sym.name).withPos(name.pos)
345345 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.
346348 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)
348351 }
349352 renameTree.foreach(traverse)
350353 traverse(tree)
@@ -556,16 +559,6 @@ object Interactive {
556559 lookup(name.sourceModuleName))
557560 }
558561
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-
569562 /**
570563 * Is this tree using a renaming introduced by an import statement?
571564 *
0 commit comments