-
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? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Open
smowton
wants to merge
14
commits into
github:main
Choose a base branch
from
smowton:smowton/admin/kotlin-2.2.0-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
44e4027
Add 2.2.0-Beta1 deps
smowton 82a7050
Bazel: update `rules_kotlin` to 2.1.3
44b7432
Add Kotlin 2.2.0-Beta1; drop Kotlin 1.5
smowton 2c90975
Fix Gradle config
smowton 3a5c203
Fix build for Kotlin 2.2.0
smowton d86becf
Update Kotlin doc table
smowton 6f0e147
Change note
smowton fcd3e8e
Update test expectation
smowton ecfbb65
Change default version
smowton 37e2314
Don't try to decode a class from a .java file
smowton e350741
Bump Kotlin version to keep integration test working
smowton 6a78163
Accept Kotlin 2.1.20 test changes
smowton 388a0e6
Bump unit tests to use latest stable Kotlin
smowton 52a632b
Fix plugin test to work with Kotlin 2.1.20
smowton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
java/kotlin-extractor/deps/kotlin-compiler-embeddable-2.2.0-Beta1.jar
Git LFS file not shown
Git LFS file not shown
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
import io | ||
import os | ||
|
||
DEFAULT_VERSION = "2.0.0" | ||
DEFAULT_VERSION = "2.1.20" | ||
|
||
|
||
def options(): | ||
|
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
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
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
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
4 changes: 2 additions & 2 deletions
4
java/kotlin-extractor/src/main/kotlin/utils/IrVisitorLookup.kt
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
3 changes: 3 additions & 0 deletions
3
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_5_0/IrLazyFunction.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
typealias IrLazyFunction = org.jetbrains.kotlin.ir.declarations.lazy.IrLazyFunction |
4 changes: 4 additions & 0 deletions
4
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_5_0/IrVisitor.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
abstract class IrVisitor<R, D> : org.jetbrains.kotlin.ir.visitors.IrElementVisitor<R, D> | ||
abstract class IrVisitorVoid : org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid |
7 changes: 7 additions & 0 deletions
7
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_5_0/getJvmDefaultMode.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.config.JvmAnalysisFlags | ||
import org.jetbrains.kotlin.config.LanguageVersionSettings | ||
|
||
fun getJvmDefaultMode(lvs: LanguageVersionSettings) = | ||
lvs.getFlag(JvmAnalysisFlags.jvmDefaultMode) |
6 changes: 6 additions & 0 deletions
6
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_5_0/isDispatchReceiver.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.ir.declarations.IrFunction | ||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter | ||
|
||
fun isDispatchReceiver(p: IrValueParameter) = p.index == -1 && p != (p.parent as? IrFunction)?.extensionReceiverParameter |
5 changes: 5 additions & 0 deletions
5
...tlin-extractor/src/main/kotlin/utils/versions/v_1_5_0/parameterIndexExcludingReceivers.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter | ||
|
||
fun parameterIndexExcludingReceivers(vp: IrValueParameter) = vp.index |
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
3 changes: 3 additions & 0 deletions
3
java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_2_0-Beta1/IrLazyFunction.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
typealias IrLazyFunction = org.jetbrains.kotlin.psi2ir.lazy.IrLazyFunction |
4 changes: 4 additions & 0 deletions
4
java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_2_0-Beta1/IrVisitor.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
typealias IrVisitor<R, D> = org.jetbrains.kotlin.ir.visitors.IrVisitor<R, D> | ||
typealias IrVisitorVoid = org.jetbrains.kotlin.ir.visitors.IrVisitorVoid |
7 changes: 7 additions & 0 deletions
7
...n/utils/versions/v_2_2_0-Beta1/createImplicitParameterDeclarationWithWrappedDescriptor.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.ir.declarations.IrClass | ||
import org.jetbrains.kotlin.ir.util.createThisReceiverParameter | ||
|
||
fun IrClass.createImplicitParameterDeclarationWithWrappedDescriptor() = | ||
this.createThisReceiverParameter() |
7 changes: 7 additions & 0 deletions
7
java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_2_0-Beta1/getJvmDefaultMode.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.config.LanguageVersionSettings | ||
import org.jetbrains.kotlin.config.jvmDefaultMode | ||
|
||
fun getJvmDefaultMode(lvs: LanguageVersionSettings) = | ||
lvs.jvmDefaultMode |
6 changes: 6 additions & 0 deletions
6
java/kotlin-extractor/src/main/kotlin/utils/versions/v_2_2_0-Beta1/isDispatchReceiver.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter | ||
import org.jetbrains.kotlin.ir.declarations.IrParameterKind | ||
|
||
fun isDispatchReceiver(p: IrValueParameter) = p.kind == IrParameterKind.DispatchReceiver |
10 changes: 10 additions & 0 deletions
10
...xtractor/src/main/kotlin/utils/versions/v_2_2_0-Beta1/parameterIndexExcludingReceivers.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.github.codeql.utils.versions | ||
|
||
import org.jetbrains.kotlin.ir.declarations.IrFunction | ||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter | ||
|
||
fun parameterIndexExcludingReceivers(vp: IrValueParameter): Int { | ||
val offset = | ||
(vp.parent as? IrFunction)?.let { (if (it.extensionReceiverParameter != null) 1 else 0) + (if (it.dispatchReceiverParameter != null) 1 else 0) } ?: 0 | ||
return vp.indexInParameters - offset | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ration-tests/kotlin/all-platforms/diagnostics/kotlin-version-too-new/diagnostics.expected
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
category: feature | ||
--- | ||
* Kotlin versions up to 2.2.0\ *x* are now supported. Support for the Kotlin 1.5.x series is dropped (so the minimum Kotlin version is now 1.6.0). |
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
4 changes: 2 additions & 2 deletions
4
java/ql/test-kotlin2/library-tests/annotations/jvmName/test.expected
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
| Test.java:2:17:2:17 | m | m | m | | ||
| test.kt:3:9:4:18 | getX_prop | getX_prop | getX | | ||
| test.kt:6:5:6:19 | getX | getX | getX | | ||
| test.kt:8:5:10:19 | changeY | changeY | setY | | ||
| test.kt:8:5:10:19 | y | y | getY | | ||
| test.kt:8:5:10:14 | changeY | changeY | setY | | ||
| test.kt:8:5:10:14 | y | y | getY | | ||
| test.kt:12:5:13:15 | method | method | fn | | ||
| test.kt:17:5:17:14 | p | p | p | | ||
| test.kt:18:5:18:32 | w | w | q | |
Oops, something went wrong.
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.
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.
We can move the necessary bits from v_1_5* into
v_1_6_0
, and delete the rest, now we have dropped 1.5 support, but that can be done in a follow-up PR.