-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add support for Kotlin 2.2.0; drop Kotlin 1.5.x #19402
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: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This pull request adds support for Kotlin 2.2.0 by introducing new Beta1 modules and updating existing utility functions to work with the new API patterns. Key changes include:
- Addition of new files in the v_2_2_0-Beta1 folder exposing updated functionality (e.g., getJvmDefaultMode, createImplicitParameterDeclarationWithWrappedDescriptor).
- Updates in legacy versions (v_1_9_0-Beta and v_1_5_0) to ensure consistency in receiver handling and parameter indexing.
- Adjustments in the KotlinFileExtractor and comment extraction logic to correctly process dispatch versus extension receivers.
Reviewed Changes
Copilot reviewed 24 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_2_0-Beta1/* | New functions leveraging Kotlin 2.2.0 APIs |
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta/CommentExtractorLighterAST.kt | Updated to use the new IrVisitorVoid type alias |
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_5_0/* | Adjusted functions for parameter indexing and default mode extraction |
java/kotlin-extractor/src/main/kotlin/utils/IrVisitorLookup.kt | Updated to depend on the new IrVisitor alias |
java/kotlin-extractor/src/main/kotlin/comments/CommentExtractor.kt | Modified receiver filtering to combine dispatch and extension receivers |
java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt |
Replaced older API usages with new functions to support Kotlin 2.2.0 |
Files not reviewed (6)
- MODULE.bazel: Language not supported
- docs/codeql/reusables/supported-versions-compilers.rst: Language not supported
- java/kotlin-extractor/build.gradle: Language not supported
- java/kotlin-extractor/deps/kotlin-compiler-2.2.0-Beta1.jar: Language not supported
- java/kotlin-extractor/deps/kotlin-compiler-embeddable-2.2.0-Beta1.jar: Language not supported
- java/kotlin-extractor/deps/kotlin-stdlib-2.2.0-Beta1.jar: Language not supported
Comments suppressed due to low confidence (2)
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta/CommentExtractorLighterAST.kt:45
- Verify that subclassing via 'IrVisitorVoid()' correctly implements all required methods compared to the previous 'IrElementVisitorVoid' interface to avoid potential mismatches in visitor behavior.
object : IrVisitorVoid() {
java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt:6011
- Confirm that restricting the check to only dispatch receivers (using isDispatchReceiver) is the intended behavior here, considering the CommentExtractor separately handles extension receivers.
if (owner is IrValueParameter && isDispatchReceiver(owner)) {
These are mainly small changes in how source-locations are ascribed to synthetic expressions, plus three real changes: - The comment extractor is performing better presumably due to improvements in the underlying representation - *= /= and %= operations are once again extracted correctly; presumably their origin information has been fixed - Reference to a static final Java field can lead to more constant propagation than before The last one might be a minor nuisance to someone trying to find references to such a field.
b981211
to
388a0e6
Compare
*=
,/=
and%=
operations are once again extracted correctly; presumably their origin information has been fixedI have also evaluated this against 2.2.0-Beta1 and see only trivial changes (loss of source-locations for some synthetic elements) which I hope will be fixed for the 2.2.0 release.