[BE JVM] KT-51271 Set proper indices generating contextual inline call

[Tests] Test inline call with context receivers and default params
This commit is contained in:
Anastasia.Shadrina
2022-02-18 02:48:05 +07:00
committed by teamcity
parent dc210fa6ef
commit 4b366ddcf6
14 changed files with 338 additions and 7 deletions
@@ -505,7 +505,7 @@ class ExpressionCodegen(
callGenerator.genValueAndPut(callee.extensionReceiverParameter!!, receiver, type, this, data)
}
callGenerator.beforeValueParametersStart()
callGenerator.beforeValueParametersStart(callee.contextReceiverParametersCount)
callee.valueParameters.subList(callee.contextReceiverParametersCount, callee.valueParameters.size)
.forEachIndexed { i, valueParameter -> handleValueParameter(i + contextReceivers.size, valueParameter) }
@@ -36,7 +36,7 @@ interface IrCallGenerator {
fun beforeCallStart() {}
fun beforeValueParametersStart() {}
fun beforeValueParametersStart(contextReceiversCount: Int) {}
fun afterCallEnd() {}
@@ -150,8 +150,8 @@ class IrInlineCodegen(
}
}
override fun beforeValueParametersStart() {
invocationParamBuilder.markValueParametersStart()
override fun beforeValueParametersStart(contextReceiversCount: Int) {
invocationParamBuilder.markValueParametersStart(contextReceiversCount)
}
override fun genInlineCall(