Kotlin: Remove a cast from extractPropertyReference

This commit is contained in:
Ian Lynagh
2022-09-06 17:19:28 +01:00
parent 07457b2b5f
commit d18d5b5cf4

View File

@@ -3678,6 +3678,11 @@ open class KotlinFileExtractor(
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
return
}
val parameterTypes = kPropertyType.arguments.map { it as? IrType }.requireNoNullsOrNull()
if (parameterTypes == null) {
logger.errorElement("Unexpected: Non-IrType parameter.", propertyReferenceExpr)
return
}
val locId = tw.getLocation(propertyReferenceExpr)
@@ -3698,7 +3703,6 @@ open class KotlinFileExtractor(
val classId = extractGeneratedClass(ids, listOf(baseClass, kPropertyType), locId, currentDeclaration)
val helper = PropertyReferenceHelper(propertyReferenceExpr, locId, ids)
val parameterTypes = kPropertyType.arguments.map { it as IrType }
helper.extractReceiverField()