Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ksp2] Resolver.getJvmName does not match behavior of kotlin compiler (getter/setter name check not match JvmAbi.startsWithIsPrefix) #2275

Open
acejingbo opened this issue Dec 27, 2024 · 0 comments

Comments

@acejingbo
Copy link

acejingbo commented Dec 27, 2024

Repro

acejingbo@92b37b9

Notice for property like isoSomething.

  • KSP1 (test pass) can correctly name its getter/setter as getIsoSomething/setIsoSomething, which match kotlin compiler behavior too
  • KSP2 (test fail) will incorrectly name its getter/setter as isoSomething/setoSomething

Personal understanding

My personal understanding is that KSP1 resolver and kotlin compiler use JvmAbi.startsWithIsPrefix, but ksp2 just develop the logic by itself, and missed the condition that check whether the letter after is is capitalized

https://github.com/JetBrains/kotlin/blob/master/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JvmAbi.kt#L88-L94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant