diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala index 7bb71aa6deee..1a7e1d50c981 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala @@ -3,7 +3,7 @@ package core package tasty import dotty.tools.tasty.{TastyFormat, TastyBuffer, TastyReader, TastyHeaderUnpickler} -import TastyFormat.NameTags._ +import TastyFormat.NameTags._, TastyFormat.nameTagToString import TastyBuffer.NameRef import scala.collection.mutable @@ -79,8 +79,10 @@ class TastyUnpickler(reader: TastyReader) { val original = readName() val target = readName() readSignedRest(original, target) - case _ => + case SUPERACCESSOR | INLINEACCESSOR | BODYRETAINER | OBJECTCLASS => simpleNameKindOfTag(tag)(readName()) + case _ => + throw MatchError(s"unknown name tag ${nameTagToString(tag)}") } assert(currentAddr == end, s"bad name $result $start $currentAddr $end") result diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 825df846ae0e..96b028fafde0 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -356,8 +356,7 @@ class TreePickler(pickler: TastyPickler) { def pickleParam(tree: Tree)(using Context): Unit = { registerTreeAddr(tree) tree match { - case tree: ValDef => pickleDef(PARAM, tree, tree.tpt) - case tree: DefDef => pickleDef(PARAM, tree, tree.tpt, tree.rhs) + case tree: ValDef => pickleDef(PARAM, tree, tree.tpt) case tree: TypeDef => pickleDef(TYPEPARAM, tree, tree.rhs) } } diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index c8220d7e7604..332b97ba3199 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -873,15 +873,9 @@ class TreeUnpickler(reader: TastyReader, } case PARAM => val tpt = readTpt()(using localCtx) - if (nothingButMods(end)) { - sym.info = tpt.tpe - ValDef(tpt) - } - else { - sym.info = ExprType(tpt.tpe) - pickling.println(i"reading param alias $name -> $currentAddr") - DefDef(Nil, tpt) - } + assert(nothingButMods(end)) + sym.info = tpt.tpe + ValDef(tpt) } goto(end) setSpan(start, tree) diff --git a/tasty/src/dotty/tools/tasty/TastyFormat.scala b/tasty/src/dotty/tools/tasty/TastyFormat.scala index e5a8a5243853..68ac21110ae0 100644 --- a/tasty/src/dotty/tools/tasty/TastyFormat.scala +++ b/tasty/src/dotty/tools/tasty/TastyFormat.scala @@ -70,7 +70,7 @@ Standard-Section: "ASTs" TopLevelStat* BOUNDED type_Term -- type bound TypeParam = TYPEPARAM Length NameRef type_Term Modifier* -- modifiers name bounds - TermParam = PARAM Length NameRef type_Term rhs_Term? Modifier* -- modifiers name : type (= rhs_Term)?. `rhsTerm` is present in the case of an aliased class parameter + TermParam = PARAM Length NameRef type_Term Modifier* -- modifiers name : type. EMPTYCLAUSE -- an empty parameter clause () SPLITCLAUSE -- splits two non-empty parameter clauses of the same kind Param = TypeParam