Skip to content

Commit

Permalink
Merge pull request #14506 from dotty-staging/fix-pickling
Browse files Browse the repository at this point in the history
Disable type simplify in unpickler
  • Loading branch information
odersky authored Feb 17, 2022
2 parents 0e479ee + 8f50785 commit 7015237
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 0 additions & 2 deletions compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,6 @@ class TreeUnpickler(reader: TastyReader,
}

val tree = if (tag < firstLengthTreeTag) readSimpleTerm() else readLengthTerm()
if (!tree.isInstanceOf[TypTree]) // FIXME: Necessary to avoid self-type cyclic reference in tasty_tools
tree.overwriteType(tree.tpe.simplified)
setSpan(start, tree)
}

Expand Down
15 changes: 15 additions & 0 deletions tests/pos/pickleSkolem.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class A

type B = A

def f[T](x: T): x.type & T = ???

def g = {
var a: B = ???
f[A](a)
}

def testNN = {
var s: String = ???
s.nn
}

0 comments on commit 7015237

Please sign in to comment.