diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-19 12:57:06 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 18:07:27 +0200 |
commit | 31f9da14e5f2357c8af3c106acccc89fdd1f222c (patch) | |
tree | 36b25a52f23dce690245a4ab122a5c1044a2af5a | |
parent | 094c3bdef0fcc725c6eada7cbf70a9c51ce1ed7e (diff) | |
download | dotty-31f9da14e5f2357c8af3c106acccc89fdd1f222c.tar.gz dotty-31f9da14e5f2357c8af3c106acccc89fdd1f222c.tar.bz2 dotty-31f9da14e5f2357c8af3c106acccc89fdd1f222c.zip |
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.
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 12 |
1 files changed, 9 insertions, 3 deletions
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 + } } } |