google / google/ksp

`experimentalPsiResolution` missing synthetic function when overriding getter of capitalized property.

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

Description

Consider the following case of a Kotlin interface with a capitalzed property and a Java implementation that overrides the property getter:

```kotlin
interface MyInterface {
val Foo: String
}

public class MyClass implements MyInterface {
@Override
public String getFoo() {
return "";
}
}
```

When enabling PSI mode we get the following diff in member declarations compared to AA mode

```diff
+ // PSI mode
- // AA mode
FUNCTION: MyInterface.getFoo (JAVA_LIB)
- FUNCTION: MyInterface.getFoo (SYNTHETIC)
```

In particular, PSI mode is missing a synthetic version of the function that exists in AA mode.

It's not clear whether PSI mode should try to match AA mode in this case or if AA mode should try to match PSI mode (by removing the extra synthetic getter). In either case, this is likely a pretty rare edge case.

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.