summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-12-18 15:18:44 +0000
committerMartin Odersky <odersky@gmail.com>2009-12-18 15:18:44 +0000
commitce4572ca49c2ba0db6b02ffffdece66c4cd3b5e8 (patch)
tree8424ae264cdfa0158c1ff8329c95c7d8798882d3 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent32bfcc419420300ecb294e5fb1c8210f5fbe6d6d (diff)
downloadscala-ce4572ca49c2ba0db6b02ffffdece66c4cd3b5e8.tar.gz
scala-ce4572ca49c2ba0db6b02ffffdece66c4cd3b5e8.tar.bz2
scala-ce4572ca49c2ba0db6b02ffffdece66c4cd3b5e8.zip
Closed #2779. review by community.
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, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index e541c58c1a..542b2d04c2 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2111,10 +2111,12 @@ trait Typers { self: Analyzer =>
(e.sym.isType || inBlock || (e.sym.tpe matches e1.sym.tpe)))
// default getters are defined twice when multiple overloads have defaults. an
// error for this is issued in RefChecks.checkDefaultsInOverloaded
- if (!e.sym.isErroneous && !e1.sym.isErroneous && !e.sym.hasFlag(DEFAULTPARAM))
+ if (!e.sym.isErroneous && !e1.sym.isErroneous && !e.sym.hasFlag(DEFAULTPARAM)) {
error(e.sym.pos, e1.sym+" is defined twice"+
{if(!settings.debug.value) "" else " in "+unit.toString})
- e1 = scope.lookupNextEntry(e1);
+ scope.unlink(e1) // need to unlink to avoid later problems with lub; see #2779
+ }
+ e1 = scope.lookupNextEntry(e1)
}
}