Repository navigation
Conversation
This means the first build when adding support for a new version actually gets as far as giving a useful error message.
The Kotlin 2.5 compiler no longer accepts an endless `while (true)` loop,
nested inside inline `use { }` lambdas, as the end of a function returning
Boolean, and reports "missing return statement". Move the line comparison
loop into a helper, equivalentTrapLines, so that it is the function body
itself. Behaviour is unchanged, and this compiles with all supported
Kotlin versions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 38400d2f-9060-4b63-8536-73ce77bb5c91
Kotlin 2.5 removed `JvmCodegenUtil` and `IrPluginContext.moduleDescriptor`, and `IrExternalPackageFragmentImpl` now needs an `IrModuleFragment`. Add two compatibility functions, with the previous behaviour in v_1_8_0 and the new one in v_2_5_0-RC2: - getCurrentJvmModuleName, used by KotlinUsesExtractor.getJvmModuleName for the name of the module being compiled. For 2.5 it applies the old JvmCodegenUtil.getModuleName logic to the module fragment's descriptor. KotlinExtractorGlobalState now holds the module fragment to support this. - createExternalPackageFragment, used to make the synthetic `kotlin.internal.ir` package for RawTypeAnnotation. For 2.5 it passes IrErrorModuleFragment, as the compiler's own JvmIrSpecialAnnotationSymbolProvider does. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 38400d2f-9060-4b63-8536-73ce77bb5c91
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The generated diagnostic expectation was edited directly instead of updating the inline test source and regenerating it, making the test change vulnerable to being overwritten.
1 open issue
What changed in this PR
Adds Kotlin 2.5.0 support using the 2.5.0-RC2 compiler baseline.
Changes:
- Registers Kotlin 2.5.0-RC2 dependencies and extractor version.
- Adds compatibility implementations for changed Kotlin compiler APIs.
- Updates diagnostics, documentation, change notes, and vendored artifacts.
| File | Description |
|---|---|
| MODULE.bazel | Registers Kotlin 2.5.0-RC2 dependencies. |
| java/ql/lib/change-notes/2026-11-30-kotlin-2.5.0.md | Documents Kotlin 2.5.0 support. |
| java/ql/integration-tests/kotlin/all-platforms/diagnostics/kotlin-version-too-new/diagnostics.expected | Updates the supported-version diagnostic expectation. |
| java/kotlin-extractor/versions.bzl | Adds the Kotlin 2.5.0-RC2 compiler baseline. |
| java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_5_0-RC2/getCurrentJvmModuleName.kt | Provides Kotlin 2.5-compatible JVM module-name resolution. |
| java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_5_0-RC2/createExternalPackageFragment.kt | Provides Kotlin 2.5-compatible external package-fragment creation. |
| java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_8_0/getCurrentJvmModuleName.kt | Defines baseline JVM module-name resolution compatibility. |
| java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_8_0/createExternalPackageFragment.kt | Defines baseline external package-fragment creation compatibility. |
| java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt | Uses version-aware external package-fragment creation. |
| java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt | Uses version-aware JVM module-name resolution. |
| java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt | Passes module context through extractor state and refactors trap comparison. |
| java/kotlin-extractor/deps/kotlin-stdlib-2.5.0-RC2.jar | Adds the Kotlin 2.5.0-RC2 standard library artifact. |
| java/kotlin-extractor/deps/kotlin-compiler-embeddable-2.5.0-RC2.jar | Adds the Kotlin 2.5.0-RC2 embeddable compiler artifact. |
| java/kotlin-extractor/deps/kotlin-compiler-2.5.0-RC2.jar | Adds the Kotlin 2.5.0-RC2 compiler artifact. |
| docs/codeql/reusables/supported-versions-compilers.rst | Updates the documented Kotlin compiler support. |
Review effort: Lite (adaptive)
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "markdownMessage": "The Kotlin version installed (`999.999.999`) is too recent for this version of CodeQL. Install a version lower than 2.4.30.", | |||
| "markdownMessage": "The Kotlin version installed (`999.999.999`) is too recent for this version of CodeQL. Install a version lower than 2.5.10.", | |||
RevoltOfTheAtoms
pushed a commit
to RevoltOfTheAtoms/tend
that referenced
this pull request
Dec 2, 2026
CodeQL stops with "Kotlin version 2.5.0 is too recent" and has no override, so every run failed. The workflow is disabled in the repository settings and its badge is off the README. RELEASING.md tracks github/codeql#23328 and says how to turn it back on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.