summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-08-02 18:22:20 +0000
committerMartin Odersky <odersky@gmail.com>2009-08-02 18:22:20 +0000
commitf9c2bc54ff2e047b9c2ebc9bcae4a4d1b87be0c2 (patch)
tree1261c27f53e4f57620f3d316cf8c4828e83e4b9f /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parentd339959ff129d9c3ccabad25d924618d21b7a471 (diff)
downloadscala-f9c2bc54ff2e047b9c2ebc9bcae4a4d1b87be0c2.tar.gz
scala-f9c2bc54ff2e047b9c2ebc9bcae4a4d1b87be0c2.tar.bz2
scala-f9c2bc54ff2e047b9c2ebc9bcae4a4d1b87be0c2.zip
Deleted IDeSupport.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 78b2e29048..fcb4833df7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -575,6 +575,18 @@ trait Contexts { self: Analyzer =>
result
}
+ def allImportedSymbols: List[Symbol] =
+ qual.tpe.members flatMap (transformImport(tree.selectors, _))
+
+ private def transformImport(selectors: List[(Name, Name)], sym: Symbol): List[Symbol] = selectors match {
+ case List() => List()
+ case List((nme.WILDCARD, _)) => List(sym)
+ case (from, to) :: _ if (from == sym.name) =>
+ if (to == nme.WILDCARD) List()
+ else { val sym1 = sym.cloneSymbol; sym1.name = to; List(sym1) }
+ case _ :: rest => transformImport(rest, sym)
+ }
+
override def toString() = tree.toString()
override def hashCode = tree.hashCodeStructure + depth