aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-09-08 12:13:34 +0200
committerMartin Odersky <odersky@gmail.com>2015-09-08 12:13:34 +0200
commit71150c808111055d23ab88763a487dbf743c4b88 (patch)
tree8143864dea4f2da2909f70c3aaf13281ed27a808 /src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
parent76d083889d52a5abbf883e5577b1fd21c9a1d903 (diff)
downloaddotty-71150c808111055d23ab88763a487dbf743c4b88.tar.gz
dotty-71150c808111055d23ab88763a487dbf743c4b88.tar.bz2
dotty-71150c808111055d23ab88763a487dbf743c4b88.zip
Surivive Cyclic References when unpickling Scala 2 HK types
Closes $778. It seems impossible (or very hard) to avoid Cyclic References when unpickling Scala2 files. So we try to survive them instead. Review by @DarkDimius
Diffstat (limited to 'src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
index a3c131427..e6eb89008 100644
--- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
+++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
@@ -17,6 +17,7 @@ import printing.Printer
import io.AbstractFile
import util.common._
import typer.Checking.checkNonCyclic
+import typer.Mode
import PickleBuffer._
import scala.reflect.internal.pickling.PickleFormat._
import Decorators._
@@ -520,7 +521,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
class LocalUnpickler extends LazyType {
def startCoord(denot: SymDenotation): Coord = denot.symbol.coord
def complete(denot: SymDenotation)(implicit ctx: Context): Unit = try {
- def parseToCompletion(denot: SymDenotation) = {
+ def parseToCompletion(denot: SymDenotation)(implicit ctx: Context) = {
val tag = readByte()
val end = readNat() + readIndex
def atEnd = readIndex == end
@@ -566,7 +567,8 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
}
// println(s"unpickled ${denot.debugString}, info = ${denot.info}") !!! DEBUG
}
- atReadPos(startCoord(denot).toIndex, () => parseToCompletion(denot))
+ atReadPos(startCoord(denot).toIndex,
+ () => parseToCompletion(denot)(ctx.addMode(Mode.Scala2Unpickling)))
} catch {
case ex: RuntimeException => handleRuntimeException(ex)
}