Skip to content

Commit

Permalink
Simplify change
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Feb 8, 2023
1 parent 6bfde43 commit 661bc28
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,7 @@ class TreeUnpickler(reader: TastyReader,
case Some(sym) =>
sym
case None =>
val ownerInTree = ownerTree.findOwner(addr)
val ctx1 =
if ownerInTree.exists then ctx.withOwner(ownerInTree)
else ctx // this is a pickled expression and the owner is located outside the expression (i.e. pickled quote)
val sym = forkAt(addr).createSymbol()(using ctx1)
val sym = forkAt(addr).createSymbol()(using ctx.withOwner(ownerTree.findOwner(addr)))
report.log(i"forward reference to $sym")
sym
}
Expand Down Expand Up @@ -1624,7 +1620,8 @@ class TreeUnpickler(reader: TastyReader,
try cs match {
case ot :: cs1 =>
if (ot.addr.index == addr.index) {
current
// this is a pickled expression and the owner is located outside the expression (i.e. pickled quote)
ctx.owner
}
else if (ot.addr.index < addr.index && addr.index < ot.end.index)
search(ot.children, reader.symbolAt(ot.addr))
Expand Down

0 comments on commit 661bc28

Please sign in to comment.