Skip to content

Commit 98dd244

Browse files
committed
Kotlin: Remove a not-null-expr from the extractor
1 parent 0a7350f commit 98dd244

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,11 @@ open class KotlinFileExtractor(
35703570
logger.errorElement("Unexpected: property reference with non simple type. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
35713571
return
35723572
}
3573+
val kPropertyClass = kPropertyType.classOrNull
3574+
if (kPropertyClass == null) {
3575+
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
3576+
return
3577+
}
35733578

35743579
val locId = tw.getLocation(propertyReferenceExpr)
35753580

@@ -3583,7 +3588,7 @@ open class KotlinFileExtractor(
35833588
)
35843589

35853590
val currentDeclaration = declarationStack.peek()
3586-
val prefix = if (kPropertyType.classOrNull!!.owner.name.asString().startsWith("KMutableProperty")) "Mutable" else ""
3591+
val prefix = if (kPropertyClass.owner.name.asString().startsWith("KMutableProperty")) "Mutable" else ""
35873592
val baseClass = pluginContext.referenceClass(FqName("kotlin.jvm.internal.${prefix}PropertyReference${kPropertyType.arguments.size - 1}"))?.owner?.typeWith()
35883593
?: pluginContext.irBuiltIns.anyType
35893594

0 commit comments

Comments
 (0)