Skip to content

Commit 5c37430

Browse files
authored
Merge pull request #10329 from tamasvajk/kotlin-type-access-todo
Kotlin: Add todo comment describing type access extraction inconsistency
2 parents 89fc84d + 2a529cf commit 5c37430

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
@@ -4260,6 +4260,8 @@ open class KotlinFileExtractor(
42604260
* Extracts a type access expression and its child type access expressions in case of a generic type. Nested generics are also handled.
42614261
*/
42624262
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> {
4263+
// 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.
4264+
// For example `KFunction2<Int,Double,String>` becomes `KFunction<String>` with three child type access expressions: `Int`, `Double`, `String`.
42634265
val typeAccessId = extractTypeAccess(useType(t, typeContext), location, parent, idx, enclosingCallable, enclosingStmt)
42644266
if (t is IrSimpleType) {
42654267
extractTypeArguments(t.arguments.filterIsInstance<IrType>(), location, typeAccessId, enclosingCallable, enclosingStmt)

0 commit comments

Comments
 (0)