Skip to content

Commit defcf29

Browse files
committed
Properly unpickle TYPEREFin/TERMREFin
The member comes from a particular space but it has to be seen from the current prefix to be valid. This is why compiling viewtest.scala from TASTY stopped working two commits ago.
1 parent 86b2723 commit defcf29

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,17 +251,17 @@ class TreeUnpickler(reader: TastyReader,
251251
val space = readType()
252252
sname match {
253253
case SignedName(name, sig) =>
254-
TermRef(prefix, name, space.decl(name).atSignature(sig))
254+
TermRef(prefix, name, space.decl(name).asSeenFrom(prefix).atSignature(sig))
255255
case name =>
256-
TermRef(prefix, name, space.decl(name))
256+
TermRef(prefix, name, space.decl(name).asSeenFrom(prefix))
257257
}
258258
case TYPEREFin =>
259259
val name = readName().toTypeName
260260
val prefix = readType()
261261
val space = readType()
262262
space.decl(name) match {
263263
case symd: SymDenotation if prefix.isArgPrefixOf(symd.symbol) => TypeRef(prefix, symd.symbol)
264-
case _ => TypeRef(prefix, name, space.decl(name))
264+
case _ => TypeRef(prefix, name, space.decl(name).asSeenFrom(prefix))
265265
}
266266
case REFINEDtype =>
267267
var name: Name = readName()

compiler/test/dotty/tools/dotc/FromTastyTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class FromTastyTests extends ParallelTesting {
7979

8080
"t7223.scala",
8181
"t5428.scala",
82-
"viewtest.scala",
8382

8483
// Missing position
8584
"Course-2002-13.scala",

0 commit comments

Comments
 (0)