Skip to content

Commit 2a529cf

Browse files
committed
Kotlin: Add todo comment describing type access extraction inconsistency
1 parent 5f841f7 commit 2a529cf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4257,6 +4257,8 @@ open class KotlinFileExtractor(
42574257
* Extracts a type access expression and its child type access expressions in case of a generic type. Nested generics are also handled.
42584258
*/
42594259
private fun extractTypeAccessRecursive(t: IrType, location: Label<DbLocation>, parent: Label<out DbExprparent>, idx: Int, enclosingCallable: Label<out DbCallable>, enclosingStmt: Label<out DbStmt>, typeContext: TypeContext = TypeContext.OTHER): Label<out DbExpr> {
4260+
// TODO: `useType` substitutes types to their java equivalent, and sometimes that also means changing the number of type arguments. The below logic doesn't take this into account.
4261+
// For example `KFunction2<Int,Double,String>` becomes `KFunction<String>` with three child type access expressions: `Int`, `Double`, `String`.
42604262
val typeAccessId = extractTypeAccess(useType(t, typeContext), location, parent, idx, enclosingCallable, enclosingStmt)
42614263
if (t is IrSimpleType) {
42624264
extractTypeArguments(t.arguments.filterIsInstance<IrType>(), location, typeAccessId, enclosingCallable, enclosingStmt)

0 commit comments

Comments
 (0)