diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt index 443cd7b1b4b..bc768c5ff60 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt @@ -503,7 +503,11 @@ open class KotlinFileExtractor( private fun extractValueParameter(vp: IrValueParameter, parent: Label, idx: Int, typeSubstitution: TypeSubstitution?, parentSourceDeclaration: Label, classTypeArgsIncludingOuterClasses: List?): 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) } } diff --git a/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected b/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected index 8ce71279779..49342a2a363 100644 --- a/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected @@ -49,6 +49,9 @@ A.kt: # 16| 0: [TypeAccess] Integer #-----| 4: (Parameters) # 16| 0: [Parameter] i +# 16| 0: [TypeAccess] C> +# 16| 0: [TypeAccess] C +# 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] ;