summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-12-07 16:21:53 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-12-07 16:21:53 +0000
commit2087a249ac07195e3c78417f2dfca6587e461f99 (patch)
treeabfb543b40cb779be381475c33e817e87d5cc3fb /src/compiler
parent0f188e1b47932b05d65d699dba88dd98dd191c17 (diff)
downloadscala-2087a249ac07195e3c78417f2dfca6587e461f99.tar.gz
scala-2087a249ac07195e3c78417f2dfca6587e461f99.tar.bz2
scala-2087a249ac07195e3c78417f2dfca6587e461f99.zip
follow up on fix #3946.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/ant/Scaladoc.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/ant/Scaladoc.scala b/src/compiler/scala/tools/ant/Scaladoc.scala
index be5311b471..720aa105d1 100644
--- a/src/compiler/scala/tools/ant/Scaladoc.scala
+++ b/src/compiler/scala/tools/ant/Scaladoc.scala
@@ -384,7 +384,7 @@ class Scaladoc extends ScalaMatchingTask {
/** This is forwarding method to circumvent bug #281 in Scala 2. Remove when
* bug has been corrected.
*/
- override def getDirectoryScanner(baseDir: java.io.File) =
+ override protected def getDirectoryScanner(baseDir: java.io.File) =
super.getDirectoryScanner(baseDir)
/** Transforms a string name into a file relative to the provided base
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 5c8e474d58..67664b7262 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -329,9 +329,10 @@ abstract class RefChecks extends InfoTransform {
// todo: align accessibility implication checking with isAccessible in Contexts
val ob = other.accessBoundary(member.owner)
val mb = member.accessBoundary(member.owner)
- def isOverrideAccessOK = member.isPublic || { // member is public, definitely same or relaxed access
- (!other.isProtected || member.isProtected) && // if o is protected, so is m
- (!isRootOrNone(ob) && ob.hasTransOwner(mb)) // m relaxes o's access boundary
+ def isOverrideAccessOK = member.isPublic || { // member is public, definitely same or relaxed access
+ (!other.isProtected || member.isProtected) && // if o is protected, so is m
+ ((!isRootOrNone(ob) && ob.hasTransOwner(mb)) || // m relaxes o's access boundary
+ other.isJavaDefined) // overriding a protected java member, see #3946
}
if (!isOverrideAccessOK) {
overrideAccessError()