Drop toIrConst function with IrBuiltIns parameter
This commit is contained in:
committed by
TeamCityServer
parent
7bddc2a815
commit
b46a42be33
+1
-1
@@ -100,6 +100,6 @@ class IrConstTransformer(private val interpreter: IrInterpreter, private val irF
|
||||
private fun IrExpression.convertToConstIfPossible(type: IrType): IrExpression {
|
||||
if (this !is IrConst<*> || type is IrErrorType) return this
|
||||
if (type.isArray()) return this.convertToConstIfPossible((type as IrSimpleType).arguments.single().typeOrNull!!)
|
||||
return this.value.toIrConst(type, interpreter.irBuiltIns, this.startOffset, this.endOffset)
|
||||
return this.value.toIrConst(type, this.startOffset, this.endOffset)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,15 +65,6 @@ fun Any?.toIrConst(irType: IrType, startOffset: Int = SYNTHETIC_OFFSET, endOffse
|
||||
toIrConstOrNull(irType, startOffset, endOffset)
|
||||
?: throw UnsupportedOperationException("Unsupported const element type ${irType.makeNotNull().render()}")
|
||||
|
||||
fun Any?.toIrConst(
|
||||
irType: IrType, irBuiltIns: IrBuiltIns,
|
||||
startOffset: Int = SYNTHETIC_OFFSET, endOffset: Int = SYNTHETIC_OFFSET
|
||||
): IrConst<*> =
|
||||
toIrConstOrNull(irType, startOffset, endOffset) ?: run {
|
||||
if (irType == irBuiltIns.stringType) IrConstImpl.string(startOffset, endOffset, irType.makeNotNull(), this as String)
|
||||
else throw UnsupportedOperationException("Unsupported const element type ${irType.makeNotNull().render()}")
|
||||
}
|
||||
|
||||
internal fun State.toIrExpression(expression: IrExpression): IrExpression {
|
||||
val start = expression.startOffset
|
||||
val end = expression.endOffset
|
||||
|
||||
Reference in New Issue
Block a user