summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-02-11 11:12:28 -0800
committerJames Iry <jamesiry@gmail.com>2013-02-11 11:12:28 -0800
commit638d41b650cbaa6216fb15f0e9b6eca7eb499f06 (patch)
tree393be9c1366826e8e6e43798082e70fb57b6a087 /src
parent08e547ffd2214c696cffec10ac721051bba98fca (diff)
parentef6095af29d9d43727581993681a8aae1c1bdb39 (diff)
downloadscala-638d41b650cbaa6216fb15f0e9b6eca7eb499f06.tar.gz
scala-638d41b650cbaa6216fb15f0e9b6eca7eb499f06.tar.bz2
scala-638d41b650cbaa6216fb15f0e9b6eca7eb499f06.zip
Merge pull request #2102 from retronym/topic/tree-checker-leniancy
Tolerate symbol sharing between accessor/field.
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(", ")}")
}