[EE-IR] Fix compiling reflective access to static field
Do not require IrProperty representing a field to always have
dispatchReceiver != null. dispatchReceiver is null for static
(e.g. top-level) properties.
As noted by the comment, this was apparently meant in the original code
introduced in 771b79d0459504b2ba532aeda8af15918ec05d24.
However, dispatchReceiver was also used to get the containing class,
which required the null assertation.
Fortunately, that was changed later in
b828365bb57dcb4ee3a9ea2409d197e4d214c311.
#KT-64506 Fixed
(cherry picked from commit e6a9dc19bbf660829ab5ab70c780e3bb3d53b4d0)
diff --git a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt
index a762174..99301c1 100644
--- a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt
+++ b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -450,7 +450,7 @@
}
val type = getDeclaredClassType(call)
- return type to call.dispatchReceiver!!
+ return type to call.dispatchReceiver
}
private fun getDeclaredClassType(call: IrCall) =