Skip to content

Add regression test for nested annotation declaration order - #3259

Open
RotBolt wants to merge 3 commits into
google:mainfrom
RotBolt:test/2617-nested-annotation-source-order
Open

RotBolt wants to merge 3 commits into
google:mainfrom
RotBolt:test/2617-nested-annotation-source-order

Conversation

@RotBolt

@RotBolt RotBolt commented Oct 12, 2026 •

Copy link
Copy Markdown

Summary

  • Add a focused, parameterized processor and fixtures for nested annotation declaration ordering.
  • Provide class names through PROCESSOR INPUT, as requested in review.
  • Verify getDeclarationsInSourceOrder preserves constructor parameter order for top-level and nested annotations on JVM and Native (TARGET_BACKEND: NATIVE, WITH_FIXED_TARGET: linux_x64).
  • Mark the issue fixed because the original reproduction passes in every tested configuration.

Testing

./gradlew :kotlin-analysis-api:cleanTest :kotlin-analysis-api:test --tests '*testNestedAnnotationDeclarationOrder' --tests '*testNativeNestedAnnotationDeclarationOrder'

All 8 JVM/Native × AA/PSI × current/new-feature cases passed.

Closes #2617

@jaschdoc jaschdoc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Just a minor comment. Have you also tried this on native backends? There is a directive: TARGET_BACKEND and WITH_FIXED_TARGET. See the test native/packageDeclarations.kt for an example.

Add Native coverage requested in review.
@RotBolt

RotBolt commented Oct 29, 2026

Copy link
Copy Markdown
Author

@jaschdoc Addressed the processor parameterization comment and added Native coverage as requested. All 8 JVM/Native × AA/PSI × feature-flag cases passed locally. Could you please review the updated PR again? Thank you!

…tation-source-order

# Conflicts:
#	kotlin-analysis-api/src/test/kotlin/com/google/devtools/ksp/test/KSPUnitTestSuite.kt
@RotBolt

RotBolt commented Oct 29, 2026

Copy link
Copy Markdown
Author

Also merged the latest main and resolved the test-suite conflict, retaining both tests. Re-ran the focused JVM and Native tests afterward: all 8 configurations pass. The branch is now updated for re-review.

@RotBolt

RotBolt commented Oct 29, 2026

Copy link
Copy Markdown
Author

@jaschdoc Could you please re-review this PR? The processor now uses PROCESSOR INPUT, Native coverage has been added, and the conflict with main is resolved. All 8 focused test configurations pass. Thank you!

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.

Resolver#getDeclarationsInSourceOrder() gives incorrect order for nested annotation's values.

2 participants