summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-01-25 15:04:53 +0100
committerMartin Odersky <odersky@gmail.com>2012-01-25 15:04:53 +0100
commitc749710859d32252291802d55d48abe518ddd118 (patch)
treefef90dd9afa4c595b533cb137d27c64b66cb2ce6 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parent65a1e8bd2dbd796bedc0232615cfc3caf18fd4b3 (diff)
downloadscala-c749710859d32252291802d55d48abe518ddd118.tar.gz
scala-c749710859d32252291802d55d48abe518ddd118.tar.bz2
scala-c749710859d32252291802d55d48abe518ddd118.zip
Making reflection thread-safe.
The idea is that all operations that need to be synchronized are overriden in classes reflect.runtime.Synchronized*. Sometimes this applies to operations defined in SymbolTable, which can be directly overridden. Sometimes it is more convenient to generate SynchronizedClazz subclasses of SymbolTable classes Clazz. In the latter case, all instance creation must go over factory methods that can be overridden in the Synchronized traits.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 112aa47114..ee2e292bba 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -955,7 +955,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
// Forward reference checking ---------------------------------------------------
class LevelInfo(val outer: LevelInfo) {
- val scope: Scope = if (outer eq null) new Scope else new Scope(outer.scope)
+ val scope: Scope = if (outer eq null) newScope else newNestedScope(outer.scope)
var maxindex: Int = Int.MinValue
var refpos: Position = _
var refsym: Symbol = _