Skip to content

Commit b558531

Browse files
Fix incorrect ctx chain in TreeUnpickler
In this example: object Test { def length(l: LIST): Boolean = l eq l sealed trait LIST } trait LIST used to have the context of method length as its outer context. After this PR TreeUnpickler follows the same pattern used in Namer.
1 parent fd67973 commit b558531

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ class TreeUnpickler(reader: TastyReader,
102102
}
103103
}
104104

105-
class Completer(owner: Symbol, reader: TastyReader) extends LazyType {
105+
class Completer(owner: Symbol, reader: TastyReader)(implicit creationContext: Context) extends LazyType {
106106
import reader._
107107
def complete(denot: SymDenotation)(implicit ctx: Context): Unit = {
108+
implicit val ctx = creationContext
108109
treeAtAddr(currentAddr) =
109110
new TreeReader(reader).readIndexedDef()(
110111
ctx.withPhaseNoLater(ctx.picklerPhase).withOwner(owner))

0 commit comments

Comments
 (0)