From 10bb6a0e5efa8cc76f7bd6215ca3d2a44070850a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 20 May 2015 12:07:51 +0200 Subject: 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. --- src/dotty/tools/dotc/core/Types.scala | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') 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 } } -- cgit v1.2.3