diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 55d25eeb3654..f8a0f725ea52 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -725,10 +725,14 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) { bindings.foreach(pickleTree) } case SplicePattern(pat, args) => + val targs = Nil // SplicePattern `targs` will be added with #18271 writeByte(SPLICEPATTERN) withLength { pickleTree(pat) pickleType(tree.tpe) + for targ <- targs do + writeByte(EXPLICITtpt) + pickleTree(targ) args.foreach(pickleTree) } case Hole(_, idx, args, _) => diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index ee3c98632b95..64ea2d497295 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -1566,7 +1566,8 @@ class TreeUnpickler(reader: TastyReader, case SPLICEPATTERN => val pat = readTree() val patType = readType() - val args = until(end)(readTree()) + val (targs, args) = until(end)(readTree()).span(_.isType) + assert(targs.isEmpty, "unexpected type arguments in SPLICEPATTERN") // `targs` will be needed for #18271. Until this fearure is added they should be empty. SplicePattern(pat, args, patType) case HOLE => readHole(end, isTerm = true)