-
Notifications
You must be signed in to change notification settings - Fork 6
Fix Wither builder type resolution for nested records fix #366 #367
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
base: 1.8.x
Are you sure you want to change the base?
Conversation
|
|
Please add a test that is reproducing this problem |
|
Why did you add JVM_17? |
sdelamo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request misses tests. Is there an issue this PR aims to fix?
Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>
Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>
i just need to make the build pass because i was have |
# Conflicts: # sourcegen-generator-kotlin/build.gradle.kts # test-suite-kotlin/build.gradle.kts




Root Cause
When using @wither and @builder annotations together on nested records (records defined inside a class), the generated wither interface incorrectly references the builder class name, causing compilation errors.
Approach
Derive the builder’s package from the binary name (the string with $ for inner classes), not the canonical name.
Compute the package as the substring of recordType.getName() up to the last '.'.
Build the builder simple name using the binary part if the record is inner:
Compose the final FQN as:
Preserve generics by using TypeDef.parameterized when the record type is parameterized.
Verification
Closes: #366