Skip to content

Commit 0090429

Browse files
committed
Kotlin: Support 1.9.0
1 parent 67cd6b7 commit 0090429

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

docs/codeql/reusables/supported-versions-compilers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Java,"Java 7 to 20 [4]_","javac (OpenJDK and Oracle JDK),
2121

2222
Eclipse compiler for Java (ECJ) [5]_",``.java``
23-
Kotlin [6]_,"Kotlin 1.5.0 to 1.8.20","kotlinc",``.kt``
23+
Kotlin [6]_,"Kotlin 1.5.0 to 1.9.0","kotlinc",``.kt``
2424
JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [7]_"
2525
Python [8]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11",Not applicable,``.py``
2626
Ruby [9]_,"up to 3.2",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``"

java/kotlin-extractor/kotlin_plugin_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def version_string_to_tuple(version):
2525
ci_version = '1.8.10'
2626

2727
# Version numbers in the list need to be in semantically increasing order
28-
many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.20', '1.5.30', '1.6.0', '1.6.20', '1.7.0', '1.7.20', '1.8.0' ]
28+
many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.20', '1.5.30', '1.6.0', '1.6.20', '1.7.0', '1.7.20', '1.8.0', '1.9.0-Beta' ]
2929

3030
many_versions_tuples = [version_string_to_tuple(v) for v in many_versions]
3131

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,10 @@ open class KotlinFileExtractor(
366366

367367
val typeArgs = removeOuterClassTypeArgs(c, argsIncludingOuterClasses)
368368
if (typeArgs != null) {
369-
for ((idx, arg) in typeArgs.withIndex()) {
369+
// From 1.9, the list might change when we call erase,
370+
// so we make a copy that it is safe to iterate over.
371+
val typeArgsCopy = typeArgs.toList()
372+
for ((idx, arg) in typeArgsCopy.withIndex()) {
370373
val argId = getTypeArgumentLabel(arg).id
371374
tw.writeTypeArgs(argId, idx, id)
372375
}
@@ -5531,7 +5534,7 @@ open class KotlinFileExtractor(
55315534
return
55325535
}
55335536

5534-
val typeOwner = e.typeOperandClassifier.owner
5537+
val typeOwner = e.typeOperand.classifierOrFail.owner
55355538
if (typeOwner !is IrClass) {
55365539
logger.errorElement("Expected to find SAM conversion to IrClass. Found '${typeOwner.javaClass}' instead. Can't implement SAM interface.", e)
55375540
return
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* Kotlin versions up to 1.9.0 are now supported.

0 commit comments

Comments
 (0)