summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-02-09 16:17:16 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-02-09 16:22:09 +0100
commitef6095af29d9d43727581993681a8aae1c1bdb39 (patch)
treea6b745bdd625b56f1bab1beac10c2856f2561c40 /src
parent23b69c1e05474dc6b504d63c074629132264deaf (diff)
downloadscala-ef6095af29d9d43727581993681a8aae1c1bdb39.tar.gz
scala-ef6095af29d9d43727581993681a8aae1c1bdb39.tar.bz2
scala-ef6095af29d9d43727581993681a8aae1c1bdb39.zip
Tolerate symbol sharing between accessor/field.
Recently, TreeCheckers (-Ycheck) was extended to report on references to symbols that were not in scope, which is often a sign that some substitution or ownership changes have been omitted. But, accessor methods directly use the type of the underlying field, without cloning symbols defined in that type, such as quantified types in existentials, at the new owner. My attempt to change this broke pos/existentials.scala. Instead, I'll just look the other way in TreeCheckers.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala b/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala
index c5c3c560ea..88d10f1d72 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala
@@ -313,6 +313,9 @@ abstract class TreeCheckers extends Analyzer {
}
for {
sym <- referencedSymbols
+ // Accessors are known to steal the type of the underlying field without cloning existential symbols at the new owner.
+ // This happens in Namer#accessorTypeCompleter. We just look the other way here.
+ if !tree.symbol.isAccessor
if (sym.isTypeParameter || sym.isLocal) && !(tree.symbol hasTransOwner sym.owner)
} errorFn(s"The symbol, tpe or info of tree `(${tree}) : ${info}` refers to a out-of-scope symbol, ${sym.fullLocationString}. tree.symbol.ownerChain: ${tree.symbol.ownerChain.mkString(", ")}")
}