[LL] Avoid exceptions when analyzing inconsistent PSI in LLFirDeclarationModificationService

- The exceptions in KT-63130 occur because PSI tree change events may be
  published when parts of the PSI under modification are inconsistent.
  Such inconsistent elements are then analyzed by
  `LLFirDeclarationModificationService` to check if the modification
  occurs in a contract statement.
- The solution adds `*OrNull` functions to `KtQualifiedExpression` which
  return `null` instead of failing with an exception when the receiver
  or selector cannot be found.

^KT-63130 fixed
This commit is contained in:
Marco Pennekamp
2023-11-13 19:59:35 +01:00
committed by Space Team
parent 6c67835128
commit 6668cc281d
6 changed files with 43 additions and 17 deletions
@@ -1,5 +1,3 @@
// IGNORE_FIR
import kotlin.contracts.InvocationKind
inline fun foo(block: () -> Unit) {
@@ -1,5 +1,3 @@
// IGNORE_FIR
fun foo(string: String) {
<expr>string.length</expr>
}