Skip to content

Commit 90fdd7e

Browse files
committed
Kotlin: Reuse codeQlWithHasQuestionMark
1 parent bb93179 commit 90fdd7e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.codeql
22

33
import com.github.codeql.utils.*
4+
import com.github.codeql.utils.versions.codeQlWithHasQuestionMark
45
import com.github.codeql.utils.versions.isRawType
56
import com.semmle.extractor.java.OdasaOutput
67
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
@@ -1306,7 +1307,7 @@ open class KotlinUsesExtractor(
13061307
if (t.isArray() || t.isNullableArray()) {
13071308
val elementType = t.getArrayElementType(pluginContext.irBuiltIns)
13081309
val erasedElementType = erase(elementType)
1309-
return withQuestionMark((classifier as IrClassSymbol).typeWith(erasedElementType), t.hasQuestionMark)
1310+
return (classifier as IrClassSymbol).typeWith(erasedElementType).codeQlWithHasQuestionMark(t.hasQuestionMark)
13101311
}
13111312

13121313
if (owner is IrClass) {
@@ -1430,6 +1431,4 @@ open class KotlinUsesExtractor(
14301431
return tw.getVariableLabelFor<DbLocalvar>(v)
14311432
}
14321433

1433-
fun withQuestionMark(t: IrType, hasQuestionMark: Boolean) = if(hasQuestionMark) t.makeNullable() else t.makeNotNull()
1434-
14351434
}

0 commit comments

Comments
 (0)