diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-05 17:40:41 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:08 +0200 |
commit | 78b2672d7440979c36800cbd4f1d7dbf867a4a16 (patch) | |
tree | 7c7ee1af5d2dab0bb43a7d3b11186b9de28a0d3e /src/dotty/tools | |
parent | c541ef911b963a3d49613aecf76abc8f0fa00b67 (diff) | |
download | dotty-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')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 1 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/TypeComparer.scala | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 3a1c589a9..1417347bf 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1641,6 +1641,7 @@ object SymDenotations { */ def isCachable(tp: Type): Boolean = tp match { case _: TypeErasure.ErasedValueType => false + case tp: TypeRef if tp.symbol.isClass => true case tp: TypeVar => tp.inst.exists && inCache(tp.inst) case tp: TypeProxy => inCache(tp.underlying) case tp: AndOrType => inCache(tp.tp1) && inCache(tp.tp2) 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) => |