Skip to content

Commit d18d5b5

Browse files
committed
Kotlin: Remove a cast from extractPropertyReference
1 parent 07457b2 commit d18d5b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3678,6 +3678,11 @@ open class KotlinFileExtractor(
36783678
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
36793679
return
36803680
}
3681+
val parameterTypes = kPropertyType.arguments.map { it as? IrType }.requireNoNullsOrNull()
3682+
if (parameterTypes == null) {
3683+
logger.errorElement("Unexpected: Non-IrType parameter.", propertyReferenceExpr)
3684+
return
3685+
}
36813686

36823687
val locId = tw.getLocation(propertyReferenceExpr)
36833688

@@ -3698,7 +3703,6 @@ open class KotlinFileExtractor(
36983703
val classId = extractGeneratedClass(ids, listOf(baseClass, kPropertyType), locId, currentDeclaration)
36993704

37003705
val helper = PropertyReferenceHelper(propertyReferenceExpr, locId, ids)
3701-
val parameterTypes = kPropertyType.arguments.map { it as IrType }
37023706

37033707
helper.extractReceiverField()
37043708

0 commit comments

Comments
 (0)