@@ -115,7 +115,6 @@ open class KotlinFileExtractor(
115
115
116
116
val exceptionOnFile = System .getenv(" CODEQL_KOTLIN_INTERNAL_EXCEPTION_WHILE_EXTRACTING_FILE" )
117
117
if (exceptionOnFile != null ) {
118
- @OptIn(kotlin.ExperimentalStdlibApi ::class ) // Annotation required by kotlin versions < 1.5
119
118
if (exceptionOnFile.lowercase() == file.name.lowercase()) {
120
119
throw Exception (" Internal testing exception" )
121
120
}
@@ -398,7 +397,7 @@ open class KotlinFileExtractor(
398
397
// Extract the outer <-> inner class relationship, passing on any type arguments in excess to this class' parameters if this is an inner class.
399
398
// For example, in `class Outer<T> { inner class Inner<S> { } }`, `Inner<Int, String>` nests within `Outer<Int>` and raw `Inner<>` within `Outer<>`,
400
399
// but for a similar non-`inner` (in Java terms, static nested) class both `Inner<Int>` and `Inner<>` nest within the unbound type `Outer`.
401
- val useBoundOuterType = (c.isInner || c.isLocal) && (c.parents.map { // Would use ` firstNotNullOfOrNull`, but this doesn't exist in Kotlin 1.4
400
+ val useBoundOuterType = (c.isInner || c.isLocal) && (c.parents.firstNotNullOfOrNull {
402
401
when (it) {
403
402
is IrClass -> when {
404
403
it.typeParameters.isNotEmpty() -> true // Type parameters visible to this class -- extract an enclosing bound or raw type.
@@ -407,7 +406,7 @@ open class KotlinFileExtractor(
407
406
}
408
407
else -> null // Look through enclosing non-class entities (this may need to change)
409
408
}
410
- }.firstOrNull { it != null } ? : false )
409
+ } ? : false )
411
410
412
411
extractEnclosingClass(c.parent, id, c, locId, if (useBoundOuterType) argsIncludingOuterClasses?.drop(c.typeParameters.size) else listOf ())
413
412
0 commit comments