From 3b53a8300f09c11a9fc889dbe59061a6941d21cc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 6 Apr 2015 13:26:07 +0200 Subject: Homogenize #Apply projections. Simplify fully applied #Apply projections before comparing trees. Such projections are now (correctly) simplified on unpickling but persist in the original tree before pickling. The discrepancy was uncovered by the last commit. --- src/dotty/tools/dotc/printing/PlainPrinter.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/printing/PlainPrinter.scala') diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index 8669db9a0..ce33132ab 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -43,7 +43,9 @@ class PlainPrinter(_ctx: Context) extends Printer { case tp: TypeVar if tp.isInstantiated => homogenize(tp.instanceOpt) case AndType(tp1, tp2) => homogenize(tp1) & homogenize(tp2) case OrType(tp1, tp2) => homogenize(tp1) | homogenize(tp2) - case _ => tp + case _ => + val tp1 = tp.simplifyApply + if (tp1 eq tp) tp else homogenize(tp1) } else tp -- cgit v1.2.3