JVM_IR: support function references with default parameters

This commit is contained in:
Georgy Bronnikov
2019-09-24 20:52:02 +03:00
parent 1a7f1dff10
commit 1abdcf3f57
9 changed files with 62 additions and 5 deletions
@@ -231,7 +231,8 @@ private fun IrTypeParameter.copySuperTypesFrom(source: IrTypeParameter) {
fun IrFunction.copyValueParametersToStatic(
source: IrFunction,
origin: IrDeclarationOrigin,
dispatchReceiverType: IrType? = source.dispatchReceiverParameter?.type
dispatchReceiverType: IrType? = source.dispatchReceiverParameter?.type,
numValueParametersToCopy: Int = source.valueParameters.size
) {
val target = this
assert(target.valueParameters.isEmpty())
@@ -266,6 +267,7 @@ fun IrFunction.copyValueParametersToStatic(
}
for (oldValueParameter in source.valueParameters) {
if (oldValueParameter.index >= numValueParametersToCopy) break
target.valueParameters.add(
oldValueParameter.copyTo(
target,