https://kotlinlang.org logo
#compiler
Title
# compiler
m

murdock

01/10/2021, 1:18 AM
Heyo, how would one build a IrCall with a vararg as value parameter?
r

rnett

01/10/2021, 1:32 AM
You want something like
Copy code
fun varargOf(elementType: IrType, elements: Iterable<IrExpression>) = IrVarargImpl(
        UNDEFINED_OFFSET,
        UNDEFINED_OFFSET,
        context.irBuiltIns.arrayClass.typeWith(elementType),
        elementType,
        elements.toList()
    )
Afaik there's no existing method for this
m

murdock

01/10/2021, 1:11 PM
Thanks il give it a go later this evening
2 Views