From 65c26bacbba91850922cfffabfbc6847102bc489 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 21 Jun 2016 17:24:03 +0200 Subject: Avoid cyclic errors when reading nsc.Global With the change in the next commit this addition is needed to make i859.scala compile. Previously the same effect was achieved accidentally by `updateTypeParams`. The comment admits that we do not really know why the functionality is needed. --- src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dotty/tools/dotc/core/unpickleScala2') diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index 239dd4124..2ea911380 100644 --- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -135,6 +135,13 @@ object Scala2Unpickler { denot.info = ClassInfo( // final info, except possibly for typeparams ordering denot.owner.thisType, denot.classSymbol, parentRefs, decls, ost) denot.updateTypeParams(tparams) + + // Curiously the following line is needed to make pos/i859.scala compile. + // This test simply accesses scala.tools.nsc.Global. I could not track down why + // the reference is needed - referencing any field of the type parameter + // does the trick, no completion is needed (in fact such completion would + // cause cyclic references elsewhere). + assert(denot.typeParams.forall(_.exists)) } } -- cgit v1.2.3