mirror of
https://github.com/github/codeql.git
synced 2026-02-12 05:01:06 +01:00
Kotlin: Create IrSimpleType factory function to support constructor changes introduced in Kotlin 2.3
This commit is contained in:
@@ -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
|
||||
)
|
||||
@@ -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
|
||||
)
|
||||
Reference in New Issue
Block a user