Skip to content

Commit 846edf8

Browse files
committed
Kotlin: Use withHasQuestionMark wrapper
1 parent 807f03a commit 846edf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt

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

33
import com.github.codeql.KotlinUsesExtractor
44
import com.github.codeql.getJavaEquivalentClassId
5+
import com.github.codeql.utils.versions.codeQlWithHasQuestionMark
56
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
67
import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor
78
import org.jetbrains.kotlin.backend.common.lower.parents
@@ -66,7 +67,7 @@ private fun subProjectedType(substitutionMap: Map<IrTypeParameterSymbol, IrTypeA
6667
if (conflictingVariance(outerVariance, substitutedTypeArg.variance))
6768
IrStarProjectionImpl
6869
else {
69-
val newProjectedType = substitutedTypeArg.type.let { if (t.hasQuestionMark) it.withHasQuestionMark(true) else it }
70+
val newProjectedType = substitutedTypeArg.type.let { if (t.hasQuestionMark) it.codeQlWithHasQuestionMark(true) else it }
7071
val newVariance = combineVariance(outerVariance, substitutedTypeArg.variance)
7172
makeTypeProjection(newProjectedType, newVariance)
7273
}
@@ -191,7 +192,7 @@ fun IrTypeArgument.withQuestionMark(b: Boolean): IrTypeArgument =
191192
is IrStarProjection -> this
192193
is IrTypeProjection ->
193194
this.type.let { when(it) {
194-
is IrSimpleType -> if (it.hasQuestionMark == b) this else makeTypeProjection(it.withHasQuestionMark(b), this.variance)
195+
is IrSimpleType -> if (it.hasQuestionMark == b) this else makeTypeProjection(it.codeQlWithHasQuestionMark(b), this.variance)
195196
else -> this
196197
}}
197198
else -> this

0 commit comments

Comments
 (0)