aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorliu fengyun <liu@fengy.me>2017-04-04 13:00:15 +0200
committerliu fengyun <liu@fengy.me>2017-04-04 23:17:11 +0200
commit9191d636138a025c9967c11e37900dacf0bab1c2 (patch)
treef7db6292f6b1a298a58877124f85a94d24369cc1 /compiler/src/dotty/tools/dotc/core
parenta71cb970b779692d2dd68cd9ba00d2be5e6759be (diff)
downloaddotty-9191d636138a025c9967c11e37900dacf0bab1c2.tar.gz
dotty-9191d636138a025c9967c11e37900dacf0bab1c2.tar.bz2
dotty-9191d636138a025c9967c11e37900dacf0bab1c2.zip
fix #2166: unpickling of shared CaseDef
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core')
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index a9ea49ad1..0e05fb348 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -1062,7 +1062,13 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle
}
def readCases(end: Addr)(implicit ctx: Context): List[CaseDef] =
- collectWhile(nextByte == CASEDEF && currentAddr != end) { readCase()(ctx.fresh.setNewScope) }
+ collectWhile((nextByte == CASEDEF || nextByte == SHARED) && currentAddr != end) {
+ if (nextByte == SHARED) {
+ readByte()
+ forkAt(readAddr()).readCase()(ctx.fresh.setNewScope)
+ }
+ else readCase()(ctx.fresh.setNewScope)
+ }
def readCase()(implicit ctx: Context): CaseDef = {
val start = currentAddr