mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Adjust opt-in required to use string-manipulation functions in Kotlin <= 1.5
This commit is contained in:
@@ -67,7 +67,6 @@ open class KotlinUsesExtractor(
|
||||
TypeResult(fakeKotlinType(), "", "")
|
||||
)
|
||||
|
||||
@OptIn(kotlin.ExperimentalStdlibApi::class) // Annotation required by kotlin versions < 1.5
|
||||
fun extractFileClass(f: IrFile): Label<out DbClass> {
|
||||
val pkg = f.fqName.asString()
|
||||
val jvmName = getFileClassName(f)
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.load.kotlin.JvmPackagePartSource
|
||||
// for `that`.
|
||||
private fun getName(d: IrDeclarationWithName) = (d as? IrAnnotationContainer)?.let { getJvmName(it) } ?: d.name.asString()
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class) // Annotation required by kotlin versions < 1.5
|
||||
fun getFileClassName(f: IrFile) =
|
||||
getJvmName(f) ?:
|
||||
((f.fileEntry.name.replaceFirst(Regex(""".*[/\\]"""), "")
|
||||
|
||||
Reference in New Issue
Block a user