Skip to content

TreeUnpickler: remove old syntax #10224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2020
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