Skip to content

Commit ade838b

Browse files
committed
Inline fun: remove recursion inside includesCallOf
Probably #KT-17330 Fixed
1 parent a87da43 commit ade838b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

idea/src/org/jetbrains/kotlin/idea/refactoring/inline/KotlinInlineFunctionHandler.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ class KotlinInlineFunctionHandler: InlineActionHandler() {
133133

134134
private fun KtExpression.includesCallOf(descriptor: FunctionDescriptor, context: BindingContext): Boolean {
135135
val refDescriptor = getResolvedCall(context)?.resultingDescriptor
136-
return descriptor == refDescriptor ||
137-
anyDescendantOfType<KtExpression> { it !== this && it.includesCallOf(descriptor, context) }
136+
return descriptor == refDescriptor || anyDescendantOfType<KtExpression> {
137+
it !== this && descriptor == it.getResolvedCall(context)?.resultingDescriptor
138+
}
138139
}
139140

140141
}

0 commit comments

Comments
 (0)