aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeComparer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-05 17:40:41 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:08 +0200
commit78b2672d7440979c36800cbd4f1d7dbf867a4a16 (patch)
tree7c7ee1af5d2dab0bb43a7d3b11186b9de28a0d3e /src/dotty/tools/dotc/core/TypeComparer.scala
parentc541ef911b963a3d49613aecf76abc8f0fa00b67 (diff)
downloaddotty-78b2672d7440979c36800cbd4f1d7dbf867a4a16.tar.gz
dotty-78b2672d7440979c36800cbd4f1d7dbf867a4a16.tar.bz2
dotty-78b2672d7440979c36800cbd4f1d7dbf867a4a16.zip
Add a case where caching was missing.
Gave several times improvement for linker.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index e3c05e55f..fff60f7d5 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -88,7 +88,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
assert(isSatisfiable, constraint.show)
}
- protected def isSubType(tp1: Type, tp2: Type): Boolean = ctx.traceIndented(s"isSubType ${traceInfo(tp1, tp2)}", subtyping) /*<|<*/ {
+ protected def isSubType(tp1: Type, tp2: Type): Boolean = ctx.traceIndented(s"isSubType ${traceInfo(tp1, tp2)}", subtyping) {
if (tp2 eq NoType) false
else if (tp1 eq tp2) true
else {
@@ -374,14 +374,15 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
}
compareRefined
case tp2: RecType =>
- tp1.safeDealias match {
+ def compareRec = tp1.safeDealias match {
case tp1: RecType =>
val rthis1 = RecThis(tp1)
isSubType(tp1.parent, tp2.parent.substRecThis(tp2, rthis1))
case _ =>
val tp1stable = ensureStableSingleton(tp1)
isSubType(fixRecs(tp1stable, tp1stable.widenExpr), tp2.parent.substRecThis(tp2, tp1stable))
- }
+ }
+ compareRec
case tp2 @ HKApply(tycon2, args2) =>
compareHkApply2(tp1, tp2, tycon2, args2)
case tp2 @ TypeLambda(tparams2, body2) =>