Extract type access expression for parameter types

This commit is contained in:
Tamas Vajk
2022-04-14 14:09:28 +02:00
committed by Ian Lynagh
parent f557719fe5
commit d6cbcdc847
2 changed files with 10 additions and 1 deletions

View File

@@ -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)
}
}

View File

@@ -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>;