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