Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use preexisting tag for pickling of match with sub cases
  • Loading branch information
EugeneFlesselle committed Aug 21, 2025
commit e5a73b00dc00c5c9e6dc9ac338ca6c397a783010
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
if (tree.isInline)
if (selector.isEmpty) writeByte(IMPLICIT)
else { writeByte(INLINE); pickleTree(selector) }
else if tree.isSubMatch then { writeByte(WITH); pickleTree(selector) }
else if tree.isSubMatch then { writeByte(LAZY); pickleTree(selector) }
else pickleTree(selector)
tree.cases.foreach(pickleTree)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ class TreeUnpickler(reader: TastyReader,
readByte()
InlineMatch(readTree(), readCases(end))
}
else if nextByte == WITH then
else if nextByte == LAZY then // similarly to InlineMatch we use an arbitrary Cat.1 tag
readByte()
SubMatch(readTree(), readCases(end))
else Match(readTree(), readCases(end)))
Expand Down
1 change: 0 additions & 1 deletion tasty/src/dotty/tools/tasty/TastyFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ object TastyFormat {
final val EMPTYCLAUSE = 45
final val SPLITCLAUSE = 46
final val TRACKED = 47
final val WITH = 48

// Tree Cat. 2: tag Nat
final val firstNatTreeTag = SHAREDterm
Expand Down