Kotlin: Add support for Kotlin 2.3.0

This commit is contained in:
Anders Fugmann
2025-12-04 16:14:13 +01:00
parent bc419fd35c
commit 07e5479aff
8 changed files with 27 additions and 7 deletions

BIN
java/kotlin-extractor/deps/kotlin-compiler-2.3.0.jar (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
java/kotlin-extractor/deps/kotlin-stdlib-2.3.0.jar (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -27,7 +27,7 @@ import shutil
import io
import os
DEFAULT_VERSION = "2.2.0"
DEFAULT_VERSION = "2.3.0"
def options():

View File

@@ -1645,7 +1645,7 @@ open class KotlinFileExtractor(
extractMethodAndParameterTypeAccesses: Boolean,
typeSubstitution: TypeSubstitution?,
classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?
) =
) : Label<out DbCallable> =
forceExtractFunction(
f,
parentId,
@@ -2975,12 +2975,22 @@ open class KotlinFileExtractor(
val locId = tw.getLocation(s)
tw.writeStmts_block(blockId, parent, idx, callable)
tw.writeHasLocation(blockId, locId)
extractVariable(s.delegate, callable, blockId, 0)
// For Kotlin < 2.3, s.deligate is not-nullable. Cast to a be nullable,
// as a workaround to silence warnings for kotlin < 2.3 about the elvis
// operator being redundant.
// For Kotlin >= 2.3, the cast is redundant, so we need to silence that warning
@Suppress("USELESS_CAST")
val delegate = (s.delegate as IrVariable?) ?: run {
logger.errorElement("Local delegated property is missing delegate", s)
return
}
extractVariable(delegate, callable, blockId, 0)
val propId = tw.getFreshIdLabel<DbKt_property>()
tw.writeKtProperties(propId, s.name.asString())
tw.writeHasLocation(propId, locId)
tw.writeKtPropertyDelegates(propId, useVariable(s.delegate))
tw.writeKtPropertyDelegates(propId, useVariable(delegate))
// Getter:
extractStatement(s.getter, callable, blockId, 1)

View File

@@ -849,9 +849,6 @@ open class KotlinUsesExtractor(
}
private fun useSimpleType(s: IrSimpleType, context: TypeContext): TypeResults {
if (s.abbreviation != null) {
// TODO: Extract this information
}
// We use this when we don't actually have an IrClass for a class
// we want to refer to
// TODO: Eliminate the need for this if possible

View File

@@ -9,6 +9,7 @@ VERSIONS = [
"2.1.20-Beta1",
"2.2.0-Beta1",
"2.2.20-Beta2",
"2.3.0",
]
def _version_to_tuple(v):