Skip to content

Commit 3d8aca6

Browse files
committed
Add type argument encoding to SPLICEPATTERN
Future proof for #18271.
1 parent 31fe897 commit 3d8aca6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,10 +725,14 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
725725
bindings.foreach(pickleTree)
726726
}
727727
case SplicePattern(pat, args) =>
728+
val targs = Nil // SplicePattern `targs` will be added with #18271
728729
writeByte(SPLICEPATTERN)
729730
withLength {
730731
pickleTree(pat)
731732
pickleType(tree.tpe)
733+
for targ <- targs do
734+
writeByte(EXPLICITtpt)
735+
pickleTree(targ)
732736
args.foreach(pickleTree)
733737
}
734738
case Hole(_, idx, args, _) =>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,8 @@ class TreeUnpickler(reader: TastyReader,
15661566
case SPLICEPATTERN =>
15671567
val pat = readTree()
15681568
val patType = readType()
1569-
val args = until(end)(readTree())
1569+
val (targs, args) = until(end)(readTree()).span(_.isType)
1570+
assert(targs.isEmpty, "unexpected type arguments in SPLICEPATTERN") // `targs` will be needed for #18271. Until this fearure is added they should be empty.
15701571
SplicePattern(pat, args, patType)
15711572
case HOLE =>
15721573
readHole(end, isTerm = true)

0 commit comments

Comments
 (0)