From 31f9da14e5f2357c8af3c106acccc89fdd1f222c Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 19 Jul 2015 12:57:06 +0200 Subject: Temporary fix to testLifted Discrepancies between numbers of formal and actual type arguments were observed when typing partialFunctions.scala under new scheme. Should come back to this when subtyping is rewrittem/simplified to work with new hk-scheme. Maybe testLifted is no longer needed at all. --- src/dotty/tools/dotc/core/TypeApplications.scala | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala') diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index a40047c39..c20d52d0d 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -15,6 +15,7 @@ import typer.Mode import util.Positions.Position import config.Printers._ import collection.mutable +import java.util.NoSuchElementException object TypeApplications { @@ -624,8 +625,13 @@ class TypeApplications(val self: Type) extends AnyVal { case nil => false } - if (tparams.isEmpty) false - else if (typeParams.nonEmpty) p(EtaExpand) || classBounds.nonEmpty && tryLift(self.baseClasses) - else classBounds.nonEmpty && tryLift(self.baseClasses) + try { // temporary, to avoid type mismatches in applications. Should come back to this + // when subtyping is rewritten to account for new hk-scheme. + if (tparams.isEmpty) false + else if (typeParams.nonEmpty) p(EtaExpand) || classBounds.nonEmpty && tryLift(self.baseClasses) + else classBounds.nonEmpty && tryLift(self.baseClasses) + } catch { + case ex: NoSuchElementException => false + } } } -- cgit v1.2.3