From be5c0ea28bab813e2534811ad5814f45b23c72c1 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Tue, 14 Jul 2015 13:24:18 +0300 Subject: [PATCH] Renamed function --- .../kotlin/resolve/lazy/PartialBodyResolveFilter.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt b/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt index d24c58ee33f..bc63a7b9bcc 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt @@ -69,7 +69,7 @@ class PartialBodyResolveFilter( } statementMarks.mark(elementToResolve, if (forCompletion) MarkLevel.NEED_COMPLETION else MarkLevel.NEED_REFERENCE_RESOLVE) - declaration.forEachBlock { processBlock(it) } + declaration.forTopLevelBlocksInside { processBlock(it) } } //TODO: do..while is special case @@ -123,7 +123,7 @@ class PartialBodyResolveFilter( val level = statementMarks.statementMark(statement) if (level > MarkLevel.TAKE) { // otherwise there are no statements inside that need processBlock which only works when reference resolve needed - statement.forEachBlock { nestedBlock -> + statement.forTopLevelBlocksInside { nestedBlock -> val childFilter = processBlock(nestedBlock) nameFilter.addNamesFromFilter(childFilter) } @@ -523,7 +523,7 @@ class PartialBodyResolveFilter( return element.parentsWithSelf.takeWhile { it != declaration }.firstOrNull { it.isStatement() } as JetExpression? } - private fun JetElement.forEachBlock(action: (JetBlockExpression) -> Unit) { + private fun JetElement.forTopLevelBlocksInside(action: (JetBlockExpression) -> Unit) { forEachDescendantOfType({ it !is JetBlockExpression }, action) }