Skip to content

Commit 4c28954

Browse files
Add pickling of match sub cases
1 parent 3922789 commit 4c28954

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
590590
if (tree.isInline)
591591
if (selector.isEmpty) writeByte(IMPLICIT)
592592
else { writeByte(INLINE); pickleTree(selector) }
593+
else if tree.isSubMatch then { writeByte(WITH); pickleTree(selector) }
593594
else pickleTree(selector)
594595
tree.cases.foreach(pickleTree)
595596
}

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,9 @@ class TreeUnpickler(reader: TastyReader,
15391539
readByte()
15401540
InlineMatch(readTree(), readCases(end))
15411541
}
1542+
else if nextByte == WITH then
1543+
readByte()
1544+
SubMatch(readTree(), readCases(end))
15421545
else Match(readTree(), readCases(end)))
15431546
case RETURN =>
15441547
val from = readSymRef()

tasty/src/dotty/tools/tasty/TastyFormat.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ object TastyFormat {
511511
final val EMPTYCLAUSE = 45
512512
final val SPLITCLAUSE = 46
513513
final val TRACKED = 47
514+
final val WITH = 48
514515

515516
// Tree Cat. 2: tag Nat
516517
final val firstNatTreeTag = SHAREDterm

0 commit comments

Comments
 (0)