mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
Merge pull request #10189 from igfoo/igfoo/substituteTypeAndArguments
Kotlin: Remove a cast from substituteTypeAndArguments
This commit is contained in:
@@ -123,14 +123,17 @@ private fun IrTypeArgument.lowerBound(context: IrPluginContext) =
|
||||
|
||||
fun IrType.substituteTypeAndArguments(substitutionMap: Map<IrTypeParameterSymbol, IrTypeArgument>?, useContext: KotlinUsesExtractor.TypeContext, pluginContext: IrPluginContext): IrType =
|
||||
substitutionMap?.let { substMap ->
|
||||
this.classifierOrNull?.let { typeClassifier ->
|
||||
if (this is IrSimpleType) {
|
||||
val typeClassifier = this.classifier
|
||||
substMap[typeClassifier]?.let {
|
||||
when(useContext) {
|
||||
KotlinUsesExtractor.TypeContext.RETURN -> it.upperBound(pluginContext)
|
||||
else -> it.lowerBound(pluginContext)
|
||||
}
|
||||
} ?: (this as IrSimpleType).substituteTypeArguments(substMap)
|
||||
} ?: this
|
||||
} ?: this.substituteTypeArguments(substMap)
|
||||
} else {
|
||||
this
|
||||
}
|
||||
} ?: this
|
||||
|
||||
object RawTypeAnnotation {
|
||||
|
||||
Reference in New Issue
Block a user