Skip to content

Fix ownership of symbols unpickled inside Bind nodes #4121

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
Mar 15, 2018
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ class TreeUnpickler(reader: TastyReader,
else {
for (i <- 0 until nrefs) readNat()
if (tag == BIND) {
buf += new OwnerTree(start, tag, fork, end)
goto(end)
// a Bind is never the owner of anything, so we set `end = start`
buf += new OwnerTree(start, tag, fork, end = start)
}
else scanTrees(buf, end)

scanTrees(buf, end)
}
}
else if (tag >= firstNatASTTreeTag) { readNat(); scanTree(buf) }
Expand Down
4 changes: 0 additions & 4 deletions compiler/test/dotty/tools/dotc/FromTastyTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ class FromTastyTests extends ParallelTesting {
// Closure type miss match
"eff-dependent.scala",

// Unpickling tree without owner
"patmat-bind-typed.scala",
"t8395.scala",

// Issue unpickling universes
"phantom-decls-1.scala",
"phantom-decls-3.scala",
Expand Down