[IR] Mark IrValueParameterImpl with an opt-in annotation

KT-59318
This commit is contained in:
Sergej Jaskiewicz
2023-12-07 19:08:46 +01:00
committed by Space Team
parent b56a04e796
commit f482b6a458
9 changed files with 110 additions and 87 deletions
@@ -426,14 +426,24 @@ private class ScriptsToClassesLowering(val context: JvmBackendContext, val inner
add(it)
++parametersIndex
}
addAll(irScript.explicitCallParameters.map {
IrValueParameterImpl(
it.startOffset, it.endOffset,
IrDeclarationOrigin.SCRIPT_CALL_PARAMETER, IrValueParameterSymbolImpl(),
it.name, index = parametersIndex++, type = it.type,
varargElementType = null, isCrossinline = false, isNoinline = false, isHidden = false, isAssignable = false
).also { it.parent = irScript }
})
addAll(
irScript.explicitCallParameters.map {
context.irFactory.createValueParameter(
startOffset = it.startOffset,
endOffset = it.endOffset,
origin = IrDeclarationOrigin.SCRIPT_CALL_PARAMETER,
name = it.name,
type = it.type,
isAssignable = false,
symbol = IrValueParameterSymbolImpl(),
index = parametersIndex++,
varargElementType = null,
isCrossinline = false,
isNoinline = false,
isHidden = false,
).also { it.parent = irScript }
},
)
implicitReceiversFieldsWithParameters.forEach {(_, param) ->
add(param)
}
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
import org.jetbrains.kotlin.descriptors.ParameterDescriptor
import org.jetbrains.kotlin.ir.IrImplementationDetail
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
@@ -17,7 +18,10 @@ import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.name.Name
class IrValueParameterImpl(
// IMPORTANT: This class is used in the Compose IDE plugin (platform 233).
// Don't rename it or change its constructor's signature so as not to break binary compatibility when an older version of
// the Compose IDE plugin is used with a newer version of the Kotlin IDE plugin that vendors the updated compiler version.
class IrValueParameterImpl @IrImplementationDetail constructor(
override val startOffset: Int,
override val endOffset: Int,
override var origin: IrDeclarationOrigin,