summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-06-09 13:27:31 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-06-09 14:14:45 +0200
commit666bbe730aa647a8476a33ca79beba671b80b3d2 (patch)
tree55f23b22325297b40d6794303313f28dc5c3b161 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent43ae8259f2e01393219d1ece0c87614eece32621 (diff)
downloadscala-666bbe730aa647a8476a33ca79beba671b80b3d2.tar.gz
scala-666bbe730aa647a8476a33ca79beba671b80b3d2.tar.bz2
scala-666bbe730aa647a8476a33ca79beba671b80b3d2.zip
SI-4831 Fix ambiguous import detection for renamed imports.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 2a1af2755f..fec5063bd0 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -4575,17 +4575,17 @@ trait Typers extends Modes with Adaptations with Tags {
qual = atPos(tree.pos.focusStart)(gen.mkAttributedQualifier(pre))
} else {
if (impSym.exists) {
- var impSym1 = NoSymbol
+ var impSym1: Symbol = NoSymbol
var imports1 = imports.tail
def ambiguousImport() = {
- if (!(imports.head.qual.tpe =:= imports1.head.qual.tpe))
+ if (!(imports.head.qual.tpe =:= imports1.head.qual.tpe && impSym == impSym1))
ambiguousError(
"it is imported twice in the same scope by\n"+imports.head + "\nand "+imports1.head)
}
while (errorContainer == null && !imports1.isEmpty &&
(!imports.head.isExplicitImport(name) ||
imports1.head.depth == imports.head.depth)) {
- var impSym1 = imports1.head.importedSymbol(name)
+ impSym1 = imports1.head.importedSymbol(name)
if (reallyExists(impSym1)) {
if (imports1.head.isExplicitImport(name)) {
if (imports.head.isExplicitImport(name) ||