summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Infer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-04-11 14:50:57 +0000
committerMartin Odersky <odersky@gmail.com>2011-04-11 14:50:57 +0000
commitf229addbcbdda8625b9c9788c83e60ca9cedd448 (patch)
tree7f2e050aa808d533c109491e5c83c8eaaf0deee8 /src/compiler/scala/tools/nsc/typechecker/Infer.scala
parent7872efc6144c7ec4bf27161573ccc0eb7be751be (diff)
downloadscala-f229addbcbdda8625b9c9788c83e60ca9cedd448.tar.gz
scala-f229addbcbdda8625b9c9788c83e60ca9cedd448.tar.bz2
scala-f229addbcbdda8625b9c9788c83e60ca9cedd448.zip
Closes #4402. Review by plocinic.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Infer.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 296e555559..45724f96dd 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -236,10 +236,9 @@ trait Infer {
def accessError(tree: Tree, sym: Symbol, pre: Type, explanation: String): Tree = {
val realsym = underlying(sym)
-
errorTree(tree, realsym + realsym.locationString + " cannot be accessed in " +
- (if (sym.isClassConstructor) context.enclClass.owner else pre.widen) +
- explanation)
+ (if (sym.isClassConstructor) context.enclClass.owner else pre.widen) +
+ explanation)
}
/* -- Tests & Checks---------------------------------------------------- */
@@ -258,9 +257,12 @@ trait Infer {
if (context.unit != null)
context.unit.depends += sym.toplevelClass
- val sym1 = sym filter (alt => context.isAccessible(alt, pre, site.isInstanceOf[Super]))
+ var sym1 = sym filter (alt => context.isAccessible(alt, pre, site.isInstanceOf[Super]))
// Console.println("check acc " + (sym, sym1) + ":" + (sym.tpe, sym1.tpe) + " from " + pre);//DEBUG
+ if (sym1 == NoSymbol && sym.isJavaDefined && context.unit.isJava) // don't try to second guess Java; see #4402
+ sym1 = sym
+
if (sym1 == NoSymbol) {
if (settings.debug.value) {
Console.println(context)