Skip to content

Commit eb37255

Browse files
committed
Kotlin: Create IrSimpleType factory function to support constructor changes introduced in Kotlin 2.3
1 parent 164cae8 commit eb37255

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.codeql.utils.versions
2+
3+
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
4+
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
5+
import org.jetbrains.kotlin.ir.types.IrSimpleType
6+
import org.jetbrains.kotlin.ir.types.IrTypeArgument
7+
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
8+
9+
fun codeqlIrSimpleTypeImpl(
10+
classifier: IrClassifierSymbol,
11+
isNullable: Boolean,
12+
arguments: List<IrTypeArgument>,
13+
annotations: List<IrConstructorCall>
14+
): IrSimpleType = IrSimpleTypeImpl(
15+
classifier,
16+
isNullable,
17+
arguments,
18+
annotations
19+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.github.codeql.utils.versions
2+
3+
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
4+
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
5+
import org.jetbrains.kotlin.ir.types.IrSimpleType
6+
import org.jetbrains.kotlin.ir.types.IrTypeArgument
7+
import org.jetbrains.kotlin.ir.types.SimpleTypeNullability
8+
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
9+
10+
fun codeqlIrSimpleTypeImpl(
11+
classifier: IrClassifierSymbol,
12+
isNullable: Boolean,
13+
arguments: List<IrTypeArgument>,
14+
annotations: List<IrConstructorCall>
15+
): IrSimpleType = IrSimpleTypeImpl(
16+
classifier,
17+
SimpleTypeNullability.fromHasQuestionMark(isNullable),
18+
arguments,
19+
annotations,
20+
null // originalKotlinType - explicitly pass null to avoid default parameter issues
21+
)

0 commit comments

Comments
 (0)