mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Extract type access expression for parameter types
This commit is contained in:
@@ -503,7 +503,11 @@ open class KotlinFileExtractor(
|
||||
private fun extractValueParameter(vp: IrValueParameter, parent: Label<out DbCallable>, idx: Int, typeSubstitution: TypeSubstitution?, parentSourceDeclaration: Label<out DbCallable>, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?): TypeResults {
|
||||
with("value parameter", vp) {
|
||||
val location = getLocation(vp, classTypeArgsIncludingOuterClasses)
|
||||
return extractValueParameter(useValueParameter(vp, parent), vp.type, vp.name.asString(), location, parent, idx, typeSubstitution, useValueParameter(vp, parentSourceDeclaration), vp.isVararg)
|
||||
val id = useValueParameter(vp, parent)
|
||||
if (!isExternalDeclaration(vp)) {
|
||||
extractTypeAccessRecursive(vp.type, location, id, -1)
|
||||
}
|
||||
return extractValueParameter(id, vp.type, vp.name.asString(), location, parent, idx, typeSubstitution, useValueParameter(vp, parentSourceDeclaration), vp.isVararg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,9 @@ A.kt:
|
||||
# 16| 0: [TypeAccess] Integer
|
||||
#-----| 4: (Parameters)
|
||||
# 16| 0: [Parameter] i
|
||||
# 16| 0: [TypeAccess] C<C<Integer>>
|
||||
# 16| 0: [TypeAccess] C<Integer>
|
||||
# 16| 0: [TypeAccess] Integer
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [ReturnStmt] return ...
|
||||
# 16| 0: [VarAccess] i
|
||||
@@ -56,6 +59,7 @@ A.kt:
|
||||
# 17| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 17| 0: [Parameter] i
|
||||
# 17| 0: [TypeAccess] int
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
# 18| 0: [LocalVariableDeclStmt] var ...;
|
||||
# 18| 1: [LocalVariableDeclExpr] x
|
||||
@@ -75,6 +79,7 @@ A.kt:
|
||||
# 0| 3: [TypeAccess] Enu
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] value
|
||||
# 0| 0: [TypeAccess] String
|
||||
# 23| 3: [Constructor] Enu
|
||||
# 23| 5: [BlockStmt] { ... }
|
||||
# 23| 0: [ExprStmt] <Expr>;
|
||||
|
||||
Reference in New Issue
Block a user