Use lexical scope from trace during checking suspend context if the analysis of engaged parent function isn't completed

^KT-39461 Fixed
This commit is contained in:
Victor Petukhov
2020-06-16 17:20:54 +03:00
parent 02f6a03ff7
commit 901b794af3
8 changed files with 135 additions and 12 deletions
@@ -25,7 +25,8 @@ class SuspensionPointInsideMutexLockChecker : CallChecker {
val descriptor = resolvedCall.candidateDescriptor
if (descriptor !is FunctionDescriptor || !descriptor.isSuspend) return
val enclosingSuspendFunctionSource = findEnclosingSuspendFunction(context)?.source?.getPsi() ?: return
val enclosingSuspendFunctionSource =
findEnclosingSuspendFunction(context, resolvedCall.call.callElement)?.source?.getPsi() ?: return
// Search for `synchronized` call
var parent = reportOn