mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Fix constructor call type access
This commit is contained in:
@@ -1807,10 +1807,22 @@ open class KotlinFileExtractor(
|
||||
extractExpressionExpr(dr, callable, id, -2)
|
||||
}
|
||||
|
||||
val typeAccessType = if (isAnonymous) {
|
||||
val c = (e.type as IrSimpleType).classifier.owner as IrClass
|
||||
if (c.superTypes.size == 1) {
|
||||
useType(c.superTypes.first())
|
||||
} else {
|
||||
useType(pluginContext.irBuiltIns.anyType)
|
||||
}
|
||||
} else {
|
||||
type
|
||||
}
|
||||
|
||||
val typeAccessId = tw.getFreshIdLabel<DbUnannotatedtypeaccess>()
|
||||
tw.writeExprs_unannotatedtypeaccess(typeAccessId, typeAccessType.javaResult.id, typeAccessType.kotlinResult.id, id, -3)
|
||||
tw.writeCallableEnclosingExpr(typeAccessId, callable)
|
||||
|
||||
if (e.typeArgumentsCount > 0) {
|
||||
val typeAccessId = tw.getFreshIdLabel<DbUnannotatedtypeaccess>()
|
||||
tw.writeExprs_unannotatedtypeaccess(typeAccessId, type.javaResult.id, type.kotlinResult.id, id, -3)
|
||||
tw.writeCallableEnclosingExpr(typeAccessId, callable)
|
||||
extractTypeArguments(e, typeAccessId, callable)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user