aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala12
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
+ }
}
}