summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-10-07 22:12:48 +0000
committerMiles Sabin <miles@milessabin.com>2009-10-07 22:12:48 +0000
commit611e5bd1f93bc04d7a699be376b53f3505b9414a (patch)
tree3ff4cbc843fcf09c54412655c7462576f137521c /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parenta8272bce60fae53d9164fbc7660f61bc56e6b2c0 (diff)
downloadscala-611e5bd1f93bc04d7a699be376b53f3505b9414a.tar.gz
scala-611e5bd1f93bc04d7a699be376b53f3505b9414a.tar.bz2
scala-611e5bd1f93bc04d7a699be376b53f3505b9414a.zip
Retains Import nodes until the typers phase so ...
Retains Import nodes until the typers phase so that they are available to interactive compiler clients and other AST users. Adds position information to imported names and renames.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 9128b4ed29..f31394407e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1182,17 +1182,17 @@ trait Namers { self: Analyzer =>
}
true
}
- def checkSelectors(selectors: List[(Name, Name)]): Unit = selectors match {
- case (from, to) :: rest =>
+ def checkSelectors(selectors: List[ImportSelector]): Unit = selectors match {
+ case ImportSelector(from, _, to, _) :: rest =>
if (from != nme.WILDCARD && base != ErrorType) {
if (base.member(from) == NoSymbol && base.member(from.toTypeName) == NoSymbol)
context.error(tree.pos, from.decode + " is not a member of " + expr);
if (checkNotRedundant(tree.pos, from, to))
checkNotRedundant(tree.pos, from.toTypeName, to.toTypeName)
}
- if (from != nme.WILDCARD && (rest.exists (sel => sel._1 == from)))
+ if (from != nme.WILDCARD && (rest.exists (sel => sel.name == from)))
context.error(tree.pos, from.decode + " is renamed twice");
- if ((to ne null) && to != nme.WILDCARD && (rest exists (sel => sel._2 == to)))
+ if ((to ne null) && to != nme.WILDCARD && (rest exists (sel => sel.rename == to)))
context.error(tree.pos, to.decode + " appears twice as a target of a renaming");
checkSelectors(rest)
case Nil =>