mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Kotlin: Remove a cast from extractPropertyReference
This commit is contained in:
@@ -3678,6 +3678,11 @@ open class KotlinFileExtractor(
|
|||||||
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
|
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
|
||||||
return
|
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)
|
val locId = tw.getLocation(propertyReferenceExpr)
|
||||||
|
|
||||||
@@ -3698,7 +3703,6 @@ open class KotlinFileExtractor(
|
|||||||
val classId = extractGeneratedClass(ids, listOf(baseClass, kPropertyType), locId, currentDeclaration)
|
val classId = extractGeneratedClass(ids, listOf(baseClass, kPropertyType), locId, currentDeclaration)
|
||||||
|
|
||||||
val helper = PropertyReferenceHelper(propertyReferenceExpr, locId, ids)
|
val helper = PropertyReferenceHelper(propertyReferenceExpr, locId, ids)
|
||||||
val parameterTypes = kPropertyType.arguments.map { it as IrType }
|
|
||||||
|
|
||||||
helper.extractReceiverField()
|
helper.extractReceiverField()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user