diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index af186e825591..ac315f4cef89 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -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) } diff --git a/tests/pos/pickleSkolem.scala b/tests/pos/pickleSkolem.scala new file mode 100644 index 000000000000..852b1cee65ba --- /dev/null +++ b/tests/pos/pickleSkolem.scala @@ -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 +}