Map Builders
open class MapBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
Content copied to clipboard
Functions
Link copied to clipboard
open fun Boolean.asConst(type: IrType = context.irBuiltIns.booleanType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Boolean>
Content copied to clipboard
open fun Byte.asConst(type: IrType = context.irBuiltIns.byteType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Byte>
Content copied to clipboard
open fun Char.asConst(type: IrType = context.irBuiltIns.charType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Char>
Content copied to clipboard
open fun Double.asConst(type: IrType = context.irBuiltIns.doubleType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Double>
Content copied to clipboard
open fun Float.asConst(type: IrType = context.irBuiltIns.floatType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Float>
Content copied to clipboard
open fun Int.asConst(type: IrType = context.irBuiltIns.intType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Int>
Content copied to clipboard
open fun Long.asConst(type: IrType = context.irBuiltIns.longType, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrConst<Long>
Content copied to clipboard
Link copied to clipboard
open fun IrBuilderWithScope.buildLambda(returnType: IrType?, funBuilder: IrFunctionBuilder.() -> Unit = {}, funApply: IrSimpleFunction.() -> Unit): IrSimpleFunction
Content copied to clipboard
Builds a local function to be used as a lambda, likely with lambdaArgument Return type must be specified at some point, but may be passed as null and specified later. Will be automatically set if the lambda has an expression body and it wasn't set in funBuilder or funApply
Link copied to clipboard
fun containsKey(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
fun containsValue(receiver: IrExpression, value: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
open fun createIrBuilder(symbol: IrSymbol, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): DeclarationIrBuilder
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getOrDefault(receiver: IrExpression, key: IrExpression, default: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
fun getOrElse(receiver: IrExpression, key: IrExpression, valueType: IrType = receiver.type.raiseToOrNull { it.isClassifierOf(Kotlin.Collections.Map) }
?.safeAs<IrSimpleType>()?.arguments?.get(1)?.typeOrNull
?: error("Can't auto-detect value type, must specify"), startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, otherwise: IrBlockBodyBuilder.() -> Unit): IrCall
Content copied to clipboard
Link copied to clipboard
fun getOrElseExpr(receiver: IrExpression, key: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET, otherwise: IrBuilderWithScope.() -> IrExpression): IrCall
Content copied to clipboard
Link copied to clipboard
open fun IrBuilderWithScope.irCall(funcRef: FunctionRef, type: IrType): IrCall
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun lambdaArgument(lambda: IrSimpleFunction, type: IrType = run {
//TODO workaround for https://youtrack.jetbrains.com/issue/KT-46896
val base = if (lambda.isSuspend)
context.referenceClass(
StandardNames.getSuspendFunctionClassId(lambda.allParameters.size).asSingleFqName()
)
?: error("suspend function type not found")
else
context.referenceClass(StandardNames.getFunctionClassId(lambda.allParameters.size).asSingleFqName())
?: error("function type not found")
base.typeWith(lambda.allParameters.map { it.type } + lambda.returnType)
}, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrFunctionExpression
Content copied to clipboard
Creates a IrFunctionExpressionImpl from the given function, auto-inferring the type if not specified
Link copied to clipboard
fun minusIterableKeys(receiver: IrExpression, keys: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
fun plusElementPair(receiver: IrExpression, other: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
fun plusElementPairOf(receiver: IrExpression, key: IrExpression, value: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
fun plusIterablePairs(receiver: IrExpression, other: IrExpression, startOffset: Int = UNDEFINED_OFFSET, endOffset: Int = UNDEFINED_OFFSET): IrCall
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun ClassRef.resolveTypeWith(vararg arguments: IrType): IrSimpleType
Content copied to clipboard
Link copied to clipboard
open fun <T> IrSymbolOwner.withBuilder(block: DeclarationIrBuilder.() -> T): T
Content copied to clipboard