mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Merge pull request #9401 from tamasvajk/kotlin-cleanup
Kotlin: Reuse `codeQlWithHasQuestionMark`
This commit is contained in:
@@ -1328,7 +1328,7 @@ open class KotlinUsesExtractor(
|
||||
if (t.isArray() || t.isNullableArray()) {
|
||||
val elementType = t.getArrayElementType(pluginContext.irBuiltIns)
|
||||
val erasedElementType = erase(elementType)
|
||||
return withQuestionMark((classifier as IrClassSymbol).typeWith(erasedElementType), t.hasQuestionMark)
|
||||
return (classifier as IrClassSymbol).typeWith(erasedElementType).codeQlWithHasQuestionMark(t.hasQuestionMark)
|
||||
}
|
||||
|
||||
if (owner is IrClass) {
|
||||
@@ -1452,6 +1452,4 @@ open class KotlinUsesExtractor(
|
||||
return tw.getVariableLabelFor<DbLocalvar>(v)
|
||||
}
|
||||
|
||||
fun withQuestionMark(t: IrType, hasQuestionMark: Boolean) = if(hasQuestionMark) t.makeNullable() else t.makeNotNull()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user