Skip to content

Commit f3037d6

Browse files
Kotlin: Update integration tests from -language-version 1.9 to 2.0
Kotlin 2.4.0 no longer supports -language-version 1.9. Update all integration tests that explicitly pass this flag to use 2.0 instead. Also update the extractor_information_kotlin1 expected output since -language-version 2.0 causes the extractor to report 'Uses Kotlin 2: true'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c11d827 commit f3037d6

8 files changed

Lines changed: 13 additions & 10 deletions

File tree

java/kotlin-extractor/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ kt_javac_options(
106106
"%s/%s" % (v, target)
107107
for _, target in _resources
108108
] + (
109-
["%s/%s" % (v, _compiler_plugin_registrar_service[1])] if not version_less(v, "2.4.0") else []
109+
["%s/%s" % (
110+
v,
111+
_compiler_plugin_registrar_service[1],
112+
)] if not version_less(v, "2.4.0") else []
110113
),
111114
cmd = "\n".join([
112115
"echo %s-%s > $(RULEDIR)/%s/com/github/codeql/extractor.name" % (_extractor_name_prefix, v, v),

java/ql/integration-tests/kotlin/all-platforms/enhanced-nullability/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ def test(codeql, java_full):
66
codeql.database.create(
77
command=[
88
f"javac {java_srcs} -d build",
9-
"kotlinc -language-version 1.9 user.kt -cp build",
9+
"kotlinc -language-version 2.0 user.kt -cp build",
1010
]
1111
)

java/ql/integration-tests/kotlin/all-platforms/external-property-overloads/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
def test(codeql, java_full):
5-
commands.run("kotlinc -language-version 1.9 test.kt -d lib")
6-
codeql.database.create(command="kotlinc -language-version 1.9 user.kt -cp lib")
5+
commands.run("kotlinc -language-version 2.0 test.kt -d lib")
6+
codeql.database.create(command="kotlinc -language-version 2.0 user.kt -cp lib")

java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin1/ExtractorInformation.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
| Percentage of calls with call target | 100 |
1010
| Total number of lines | 3 |
1111
| Total number of lines with extension kt | 3 |
12-
| Uses Kotlin 2: false | 1 |
12+
| Uses Kotlin 2: true | 1 |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def test(codeql, java_full):
2-
codeql.database.create(command="kotlinc -J-Xmx2G -language-version 1.9 SomeClass.kt")
2+
codeql.database.create(command="kotlinc -J-Xmx2G -language-version 2.0 SomeClass.kt")

java/ql/integration-tests/kotlin/all-platforms/file_classes/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
def test(codeql, java_full):
5-
commands.run("kotlinc -language-version 1.9 A.kt")
6-
codeql.database.create(command="kotlinc -cp . -language-version 1.9 B.kt C.kt")
5+
commands.run("kotlinc -language-version 2.0 A.kt")
6+
codeql.database.create(command="kotlinc -cp . -language-version 2.0 B.kt C.kt")

java/ql/integration-tests/kotlin/all-platforms/java-interface-redeclares-tostring/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
def test(codeql, java_full):
55
commands.run(["javac", "Test.java", "-d", "bin"])
6-
codeql.database.create(command="kotlinc -language-version 1.9 user.kt -cp bin")
6+
codeql.database.create(command="kotlinc -language-version 2.0 user.kt -cp bin")

java/ql/integration-tests/kotlin/all-platforms/kotlin_java_lowering_wildcards/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ def test(codeql, java_full):
88
command=[
99
"kotlinc kotlindefns.kt",
1010
"javac JavaUser.java JavaDefns.java -cp .",
11-
"kotlinc -language-version 1.9 -cp . kotlinuser.kt",
11+
"kotlinc -language-version 2.0 -cp . kotlinuser.kt",
1212
]
1313
)

0 commit comments

Comments
 (0)