aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-20 12:07:51 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-21 17:41:16 +0200
commit10bb6a0e5efa8cc76f7bd6215ca3d2a44070850a (patch)
treee3c85e28a7805c73d665a350ae77ee083d602d95 /src/dotty/tools/dotc/core/Types.scala
parent1746ae11926e2f09ed50e62273669b6196e60547 (diff)
downloaddotty-10bb6a0e5efa8cc76f7bd6215ca3d2a44070850a.tar.gz
dotty-10bb6a0e5efa8cc76f7bd6215ca3d2a44070850a.tar.bz2
dotty-10bb6a0e5efa8cc76f7bd6215ca3d2a44070850a.zip
Move findMember count tracking from TypeComparer to Context
Typecomparer is not a good place because it gets re-generated for new context, which causes the counts to be reset.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 476ea3841..ae9088f00 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -455,7 +455,7 @@ object Types {
val jointInfo =
if (rinfo.isAlias) rinfo
else if (pdenot.info.isAlias) pdenot.info
- else if (ctx.typeComparer.pendingMemberSearches.contains(name)) safeAnd(pdenot.info, rinfo)
+ else if (ctx.pendingMemberSearches.contains(name)) safeAnd(pdenot.info, rinfo)
else pdenot.info & rinfo
pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, jointInfo)
} else
@@ -493,12 +493,12 @@ object Types {
case _ => tp1 & tp2
}
- val cmp = ctx.typeComparer
- val recCount = cmp.findMemberCount
- cmp.findMemberCount = recCount + 1
- if (recCount >= Config.LogPendingFindMemberThreshold) {
- cmp.pendingMemberSearches = name :: cmp.pendingMemberSearches
+ { val recCount = ctx.findMemberCount + 1
+ ctx.findMemberCount = recCount
+ if (recCount >= Config.LogPendingFindMemberThreshold)
+ ctx.pendingMemberSearches = name :: ctx.pendingMemberSearches
}
+
try go(this)
catch {
case ex: MergeError =>
@@ -508,9 +508,10 @@ object Types {
throw ex // DEBUG
}
finally {
- cmp.findMemberCount = recCount - 1
+ val recCount = ctx.findMemberCount
if (recCount >= Config.LogPendingFindMemberThreshold)
- cmp.pendingMemberSearches = cmp.pendingMemberSearches.tail
+ ctx.pendingMemberSearches = ctx.pendingMemberSearches.tail
+ ctx.findMemberCount = recCount - 1
}
}