Skip to content

Commit 661bc28

Browse files
committed
Simplify change
1 parent 6bfde43 commit 661bc28

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,7 @@ class TreeUnpickler(reader: TastyReader,
265265
case Some(sym) =>
266266
sym
267267
case None =>
268-
val ownerInTree = ownerTree.findOwner(addr)
269-
val ctx1 =
270-
if ownerInTree.exists then ctx.withOwner(ownerInTree)
271-
else ctx // this is a pickled expression and the owner is located outside the expression (i.e. pickled quote)
272-
val sym = forkAt(addr).createSymbol()(using ctx1)
268+
val sym = forkAt(addr).createSymbol()(using ctx.withOwner(ownerTree.findOwner(addr)))
273269
report.log(i"forward reference to $sym")
274270
sym
275271
}
@@ -1624,7 +1620,8 @@ class TreeUnpickler(reader: TastyReader,
16241620
try cs match {
16251621
case ot :: cs1 =>
16261622
if (ot.addr.index == addr.index) {
1627-
current
1623+
// this is a pickled expression and the owner is located outside the expression (i.e. pickled quote)
1624+
ctx.owner
16281625
}
16291626
else if (ot.addr.index < addr.index && addr.index < ot.end.index)
16301627
search(ot.children, reader.symbolAt(ot.addr))

0 commit comments

Comments
 (0)