PHondogo
07/15/2025, 2:19 PMgenerated invalid IR. Please report this bug to the plugin vendor. Inconsistent index (old API) of value parameter 1 != 0
For Jvm target or Kotlin version less then 2.2.20-Beta1 compilation succeed (using the same transformation logic).
I'm using old (deprecated) methods for working with parameters.
Before digging into this issue i want to ask if there is any advice for this error message?dmitriy.novozhilov
07/15/2025, 2:28 PMWojciech Litewka
07/15/2025, 2:32 PMIrValueParameter.index*
properties? If so please try to remove it, it is not necessary now.PHondogo
07/15/2025, 2:37 PMIrValueParameter
manually.
I'm only using IrMemberAccessExpression::putValueArgument(index,expression) or IrMemberAccessExpression::dispatchReceiverPHondogo
07/15/2025, 2:42 PM@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramPutTypeArgument(call: IrMemberAccessExpression<*>, index: Int, type: IrType?) {
call.putTypeArgument(index, type)
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramDispatcherReceiverSet(func: IrFunction, param: IrValueParameter?) {
func.dispatchReceiverParameter = param
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramDispatcherReceiverSet(call: IrMemberAccessExpression<*>, value: IrExpression?) {
call.dispatchReceiver = value
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramExtensionReceiver(func: IrFunction): IrValueParameter? {
return func.extensionReceiverParameter
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramExtensionReceiverValueSet(call: IrMemberAccessExpression<*>, param: IrExpression?) {
call.extensionReceiver = param
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramValueParameters(func: IrFunction): List<IrValueParameter> {
return func.valueParameters
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramValueParametersIsEmpty(func: IrFunction): Boolean {
return func.valueParameters.isEmpty()
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramValueParametersSize(func: IrFunction): Int {
return func.valueParameters.size
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramValueParametersSet(func: IrFunction, params: List<IrValueParameter>) {
func.valueParameters = params
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramValueParameter(func: IrFunction, index: Int): IrValueParameter {
return func.valueParameters[index]
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramValueParameterOrNull(func: IrFunction, index: Int): IrValueParameter? {
return func.valueParameters.getOrNull(index)
}
@OptIn(DeprecatedForRemovalCompilerApi::class) // TODO
fun paramPutValueArgument(call: IrMemberAccessExpression<*>, index: Int, valueArgument: IrExpression?) {
call.putValueArgument(index, valueArgument)
}
PHondogo
07/15/2025, 2:42 PMPHondogo
07/15/2025, 3:20 PMPHondogo
07/15/2025, 3:22 PMPHondogo
07/15/2025, 3:22 PM