From 5041e9311bf1845d09c6eeccba816214fe25a3e6 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 7 Jun 2016 14:17:52 +0200 Subject: Make TypeAccumulators follow LazyRefs TypeMaps do the same, so it is logical, and helps prevent subtle errors as when we mispredicted whether a RecType contains references that point to it. Also, add normalizeHkApply to homogenize Fixes some discrepancies in Tasty typing. Also, homogenize skolem types Skolem types are eliminated by pickling, so they should not appear in the "before-pickling" output. --- src/dotty/tools/dotc/core/Types.scala | 3 +++ src/dotty/tools/dotc/printing/PlainPrinter.scala | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'src/dotty') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index d3e97b492..b779cbf3e 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -3708,6 +3708,9 @@ object Types { case tp: JavaArrayType => this(x, tp.elemType) + case tp: LazyRef => + this(x, tp.ref) + case tp: ProtoType => tp.fold(x, this) diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index 20bf8b407..a9f5b771a 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -53,6 +53,10 @@ class PlainPrinter(_ctx: Context) extends Printer { case tp @ TypeRef(_, tpnme.hkApplyOBS) => val tp1 = tp.reduceProjection if (tp1 eq tp) tp else homogenize(tp1) + case tp: RefinedType => + tp.normalizeHkApply + case tp: SkolemType => + homogenize(tp.info) case tp: LazyRef => homogenize(tp.ref) case _ => -- cgit v1.2.3