8000 fix: resolve annotation default values from KMP metadata by mvanhorn · Pull Request #3146 · google/ksp · GitHub
[go: up one dir, main page]

Skip to content

fix: resolve annotation default values from KMP metadata - #3146

Closed
mvanhorn wants to merge 1 commit into
google:mainfrom
mvanhorn:fix/2356-kmp-annotation-default-values
Closed

mvanhorn wants to merge 1 commit into
google:mainfrom
mvanhorn:fix/2356-kmp-annotation-default-values

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Update the existing default-value conversion in util.kt to consume a deserialized FIR value parameter's metadata-backed default expression on every target, converting it through the same FIR annotation-value machinery already used for JVM defaults. KSP2 omits default arguments declared by annotation classes in compiled Kotlin libraries when processing a non-JVM KMP target.

On a Native target, read an annotation from a compiled library through getAnnotationsByType and verify an omitted Boolean member returns its declared value instead of throwing; Omit a vararg annotation member and verify the proxy exposes an empty array, covering the empty-collection failure reported in the thread.

Fixes #2356

@jaschdoc
Copy link
Copy Markdown
Collaborator

Fixed by #3200

@jaschdoc jaschdoc closed this Sep 24, 2026
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 this pull request may close these issues.

KSP2 version 2.1.20-RC-1.0.30 crashes with NoSuchElementException: Collection contains no element matching the predicate

2 participants

0