summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-12-03 18:47:01 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-12-03 18:47:01 +0000
commit627adab5dbddcef8bd57d2b40eaa6a6e40c06cab (patch)
tree2eb20e317f78612a2c2c8a47dc0e8f7420ddfd2d /src
parent3a783937bf97a9180e303da90cea8077f75d3e9b (diff)
downloadscala-627adab5dbddcef8bd57d2b40eaa6a6e40c06cab.tar.gz
scala-627adab5dbddcef8bd57d2b40eaa6a6e40c06cab.tar.bz2
scala-627adab5dbddcef8bd57d2b40eaa6a6e40c06cab.zip
close #3951. review by dubochet.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala2
-rwxr-xr-xsrc/library/scala/reflect/generic/UnPickler.scala13
2 files changed, 12 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index e84ae10cee..e15328c6a1 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -63,7 +63,7 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
private var rawannots: List[AnnotationInfoBase] = Nil
/* Used in namer to check whether annotations were already assigned or not */
- def rawAnnotations:List[AnnotationInfoBase] = rawannots
+ def rawAnnotations: List[AnnotationInfoBase] = rawannots
/** After the typer phase (before, look at the definition's Modifiers), contains
* the annotations attached to member a definition (class, method, type, field).
diff --git a/src/library/scala/reflect/generic/UnPickler.scala b/src/library/scala/reflect/generic/UnPickler.scala
index ed103a3a43..d04b882f0d 100755
--- a/src/library/scala/reflect/generic/UnPickler.scala
+++ b/src/library/scala/reflect/generic/UnPickler.scala
@@ -65,14 +65,23 @@ abstract class UnPickler {
//println("unpickled " + classRoot + ":" + classRoot.rawInfo + ", " + moduleRoot + ":" + moduleRoot.rawInfo);//debug
def run() {
+ // read children last, fix for #3951
+ val queue = new collection.mutable.ListBuffer[() => Unit]()
+ def delay(i: Int, action: => Unit) {
+ queue += (() => at(i, {() => action; null}))
+ }
+
for (i <- 0 until index.length) {
if (isSymbolEntry(i))
at(i, readSymbol)
else if (isSymbolAnnotationEntry(i))
- at(i, {() => readSymbolAnnotation(); null})
+ delay(i, readSymbolAnnotation())
else if (isChildrenEntry(i))
- at(i, {() => readChildren(); null})
+ delay(i, readChildren())
}
+
+ for (action <- queue)
+ action()
}
private def checkVersion() {