Kotlin: Create IrSimpleType factory function to support constructor changes introduced in Kotlin 2.3

This commit is contained in:
Anders Fugmann
2026-01-05 08:50:38 +01:00
parent 164cae845d
commit eb37255c4b
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package com.github.codeql.utils.versions
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
import org.jetbrains.kotlin.ir.types.IrSimpleType
import org.jetbrains.kotlin.ir.types.IrTypeArgument
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
fun codeqlIrSimpleTypeImpl(
classifier: IrClassifierSymbol,
isNullable: Boolean,
arguments: List<IrTypeArgument>,
annotations: List<IrConstructorCall>
): IrSimpleType = IrSimpleTypeImpl(
classifier,
isNullable,
arguments,
annotations
)

View File

@@ -0,0 +1,21 @@
package com.github.codeql.utils.versions
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
import org.jetbrains.kotlin.ir.types.IrSimpleType
import org.jetbrains.kotlin.ir.types.IrTypeArgument
import org.jetbrains.kotlin.ir.types.SimpleTypeNullability
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
fun codeqlIrSimpleTypeImpl(
classifier: IrClassifierSymbol,
isNullable: Boolean,
arguments: List<IrTypeArgument>,
annotations: List<IrConstructorCall>
): IrSimpleType = IrSimpleTypeImpl(
classifier,
SimpleTypeNullability.fromHasQuestionMark(isNullable),
arguments,
annotations,
null // originalKotlinType - explicitly pass null to avoid default parameter issues
)