Skip to content

Kotlin: support 2.4.20-RC - #22404

Draft
andersfugmann wants to merge 7 commits into
mainfrom
andersfugmann/kotlin-2.4.20rc
Draft

Kotlin: support 2.4.20-RC#22404
andersfugmann wants to merge 7 commits into
mainfrom
andersfugmann/kotlin-2.4.20rc

Conversation

@andersfugmann

@andersfugmann andersfugmann commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Support Kotlin 2.4.20-RC in the Kotlin extractor. Kotlin 2.4.20 GA remains unsupported.

The implementation is split between release-driven compatibility changes and two observed RC behaviours. The release changelog explicitly removes remaining ComponentRegistrar usage (KT-85816) and applies @K1Deprecation to public K1 APIs (KT-86046). The RC compiler also gives generated interface forwarders synthetic source offsets and rejects the previous repeatable-annotation access path. The extractor adapts to those behaviours without changing query results.

Motivation for each change

Change Motivation
Add standalone, embeddable, and standard-library RC artefacts Build and test the extractor against the published v2.4.20-RC compiler rather than an inferred compatible version.
Add an RC-specific CompilerPluginRegistrar implementation ComponentRegistrar is absent from the RC compiler, matching KT-85816. The existing registrar cannot be loaded because it implements both APIs.
Package the legacy ComponentRegistrar service only before 2.4.20 Older compilers still require the legacy service, while the RC fails if that service refers to the removed class. This keeps compatibility selection at the build boundary.
Opt in to org.jetbrains.kotlin.K1Deprecation from 2.4.20 The extractor still uses K1 compatibility APIs. KT-86046 makes the opt-in an error-level requirement in the RC.
Reuse the annotationClass compatibility extension The RC rejects the previous IR parent access. The existing extension uses constructedClass and also compiles with the oldest supported Kotlin 1.8.0 compiler.
Assign fabricated interface forwarders the enclosing class location The RC reports synthetic offsets for these generated declarations. They have no direct source declaration, so the enclosing class is the stable location and preserves previous database and query output. This behaviour was observed during extraction and is not called out explicitly in the release changelog.
Make 2.4.20-RC the development and Kotlin 2 test default Exercise the newly supported compiler in the normal Kotlin 2 suite.
Test 2.4.20 GA in the too-new diagnostic Verify the intended RC-only boundary directly.
Update documentation and the change note to 2.4.20-RC Avoid implying support for 2.4.20 GA.

Compatibility

  • Compiler variants before 2.4.20 retain their existing registrar and service packaging.
  • The K1 opt-in changes compilation only and does not change extracted data.
  • Repeatable annotation extraction uses the existing cross-version compatibility path.
  • Generated forwarders retain their previous observable locations. No fake-override, AST, expression-type, or inherited-interface-default expectations change.
  • Kotlin 2.4.20 GA and other prerelease spellings remain unsupported.

Validation

  • Built all 26 extractor variants: standalone and embeddable for every compiler version declared in VERSIONS
  • Ran ten representative tests for every supported compiler and applicable language mode: K1 for Kotlin 1.8 through 2.3, and K2 for Kotlin 2.0 through 2.4
  • Built standalone and embeddable 2.4.20-RC extractor variants
  • Built the oldest supported 1.8.0 extractor variant
  • Full Kotlin 2 suite passed in eight sequential shards with one test thread
  • Full Kotlin 1 suite passed with 2.3.20 in eight sequential shards with one test thread
  • All 36 Kotlin all-platform extraction tests passed in eight sequential shards
  • All 63 Kotlin all-platform QL integration tests passed in eight sequential shards
  • The published v2.4.20-RC compiler passed the Kotlin basic functionality extraction test
  • The too-new diagnostic test rejects 2.4.20 GA

No tests are disabled. The only changed generated expectation is the too-new diagnostic.

@andersfugmann
andersfugmann force-pushed the andersfugmann/kotlin-2.4.20rc branch 7 times, most recently from f74d5b1 to 2fa6f32 Compare August 26, 2026 10:43
andersfugmann and others added 7 commits August 26, 2026 13:24
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Kotlin 2.4.20-RC removes the remaining ComponentRegistrar API under KT-85816.

Use an RC-specific registrar that only implements CompilerPluginRegistrar, and package the legacy ComponentRegistrar service only for older compilers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Kotlin 2.4.20-RC marks public K1 APIs with K1Deprecation under KT-86046 and rejects the previous repeatable-annotation IR access path.

Opt in to K1Deprecation for 2.4.20 and later, and use the existing annotationClass compatibility extension.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Kotlin 2.4.20-RC assigns synthetic source offsets to generated interface forwarders.

Use the enclosing class location for each fabricated forwarder and its generated body and accesses, preserving existing database and query output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@andersfugmann
andersfugmann force-pushed the andersfugmann/kotlin-2.4.20rc branch from 2fa6f32 to b9c81d5 Compare August 26, 2026 11:25
@andersfugmann andersfugmann self-assigned this Aug 26, 2026
@github-actions github-actions Bot added the Java label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant