Skip to content
Merged
Changes from all commits
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
11 changes: 4 additions & 7 deletions compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -981,18 +981,15 @@ class TreeUnpickler(reader: TastyReader,
assert(sourcePathAt(start).isEmpty)
readByte()
readEnd()
val importGiven = nextByte == GIVEN // TODO: drop the next time we bump Tasty versions
if (importGiven) readByte()
val expr = readTerm()
setSpan(start, Import(expr, readSelectors(importGiven)))
setSpan(start, Import(expr, readSelectors()))
}
def readSelectors(givenPrefix: Boolean)(using Context): List[untpd.ImportSelector] =
def readSelectors()(using Context): List[untpd.ImportSelector] =
if nextByte == IMPORTED then
val start = currentAddr
assert(sourcePathAt(start).isEmpty)
readByte()
var name = readName()
if givenPrefix && name == nme.WILDCARD then name = EmptyTermName
val name = readName()
val from = setSpan(start, untpd.Ident(name))
val selector = nextByte match
case RENAMED =>
Expand All @@ -1007,7 +1004,7 @@ class TreeUnpickler(reader: TastyReader,
untpd.ImportSelector(from, EmptyTree, bound)
case _ =>
untpd.ImportSelector(from)
selector :: readSelectors(givenPrefix)
selector :: readSelectors()
else
Nil

Expand Down