8000 [ksp2] Resolver.getJvmName wrong for properties starts with `is` · Issue #2275 · google/ksp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ksp2] Resolver.getJvmName wrong for properties starts with is #2275

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

Closed
acejingbo opened this issue Dec 27, 2024 · 1 comment · Fixed by #2449
Closed

[ksp2] Resolver.getJvmName wrong for properties starts with is #2275

acejingbo opened this issue Dec 27, 2024 · 1 comment · Fixed by #2449
Milestone

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

@acejingbo acejingbo changed the title [ksp2] Resolver.getJvmName does not match behavior of kotlin compiler (getter/setter name check not match JvmAbi.startsWithIsPrefix) [ksp2] Resolver.getJvmName wrong for properties starts with is Apr 16, 2025
@acejingbo
Copy link
Author

Still hitting as of 2.1.0-1.0.29. When using Room Processor.

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

Successfully merging a pull request may close this issue.

2 participants
0