Don't update null recorded type prematurely in ResolvedAtomCompleter

This commit is contained in:
Victor Petukhov
2021-05-26 18:47:16 +03:00
parent bd7fb56a24
commit 76c15e4444
4 changed files with 127 additions and 127 deletions
@@ -155,7 +155,7 @@ class ResolvedAtomCompleter(
val callElement = psiCallForResolutionContext.callElement
if (callElement is KtExpression) {
val recordedType = topLevelCallContext.trace.getType(callElement)
if ((recordedType.shouldBeUpdated()) && resolvedCall.resultingDescriptor.returnType != null) {
if (recordedType != null && recordedType.shouldBeUpdated() && resolvedCall.resultingDescriptor.returnType != null) {
topLevelCallContext.trace.recordType(callElement, resolvedCall.resultingDescriptor.returnType)
}
}