Merge pull request #9401 from tamasvajk/kotlin-cleanup

Kotlin: Reuse `codeQlWithHasQuestionMark`
This commit is contained in:
Tamás Vajk
2022-06-02 10:24:17 +02:00
committed by GitHub

View File

@@ -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()
}