google / google/ksp

[KSP2] Incorrect parentDeclaration for Java method inheriting a Kotlin property

Open
#2,498 2 comments 0 reactions 0 assignees View on GitHub
P3
Dominant language
Kotlin
Stars
3.5k
Forks
415
Avg merge
1d 2h
Merged PRs (30d)
53

Description

Reproducer:
```
// FILE: K.kt
interface MyInterface {
val property: Int
}

// FILE: MyInterfaceImplJava.java
class MyInterfaceImplJava implements MyInterface {
@Override
public int getProperty() { return 0; }
}
```

`KSDeclaration.parent` and `KSDeclaration.parentDeclaration` returns `property` instead of `MyInterfaceImplJava`. KSP1 works correctly.

I've got it in #2497.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.