Skip to content

Commit 6bee9d8

Browse files
authored
Merge pull request github#10323 from igfoo/igfoo/extractPropertyReference
Kotlin: Remove a cast from extractPropertyReference
2 parents 67f8c82 + d18d5b5 commit 6bee9d8

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
@@ -3677,6 +3677,11 @@ open class KotlinFileExtractor(
36773677
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
36783678
return
36793679
}
3680+
val parameterTypes = kPropertyType.arguments.map { it as? IrType }.requireNoNullsOrNull()
3681+
if (parameterTypes == null) {
3682+
logger.errorElement("Unexpected: Non-IrType parameter.", propertyReferenceExpr)
3683+
return
3684+
}
36803685

36813686
val locId = tw.getLocation(propertyReferenceExpr)
36823687

@@ -3697,7 +3702,6 @@ open class KotlinFileExtractor(
36973702
val classId = extractGeneratedClass(ids, listOf(baseClass, kPropertyType), locId, currentDeclaration)
36983703

36993704
val helper = PropertyReferenceHelper(propertyReferenceExpr, locId, ids)
3700-
val parameterTypes = kPropertyType.arguments.map { it as IrType }
37013705

37023706
helper.extractReceiverField()
37033707

0 commit comments

Comments
 (0)