summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-12-22 09:56:21 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-12-22 09:56:21 +0000
commit192c943c33bf387241e45785073ab14618fbd5fc (patch)
tree63776798edf8ca4a94cede2f1903ada760433954 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parentc163877ba88558c9f16393d3518b464c21c61ae5 (diff)
downloadscala-192c943c33bf387241e45785073ab14618fbd5fc.tar.gz
scala-192c943c33bf387241e45785073ab14618fbd5fc.tar.bz2
scala-192c943c33bf387241e45785073ab14618fbd5fc.zip
close #2809.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 4c919f227a..a51797fe25 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -78,7 +78,7 @@ abstract class RefChecks extends InfoTransform {
private def checkDefaultsInOverloaded(clazz: Symbol) {
def check(members: List[Symbol]): Unit = members match {
case x :: xs =>
- if (x.paramss.exists(_.exists(p => p.hasFlag(DEFAULTPARAM)))) {
+ if (x.paramss.exists(_.exists(p => p.hasFlag(DEFAULTPARAM))) && !nme.isProtectedAccessor(x.name)) {
val others = xs.filter(alt => {
alt.name == x.name &&
alt.paramss.exists(_.exists(_.hasFlag(DEFAULTPARAM))) &&
@@ -87,7 +87,7 @@ abstract class RefChecks extends InfoTransform {
if (!others.isEmpty) {
val all = x :: others
val rest = if (all.exists(_.owner != clazz)) ".\nThe members with defaults are defined in "+
- all.map(_.owner).mkString("", " and ", ".")
+ all.map(_.owner).mkString("", " and ", ".") else ""
unit.error(clazz.pos, "in "+ clazz +", multiple overloaded alternatives of "+ x +
" define default arguments"+ rest)
}