IR: fix of delegating call of primary constructor with default arguments
This commit is contained in:
committed by
vvlevchenko
parent
00dccf6175
commit
32a988df17
+3
-2
@@ -193,16 +193,17 @@ class DefaultParameterInjector internal constructor(val context: Context): BodyL
|
|||||||
val argumentsCount = argumentCount(expression)
|
val argumentsCount = argumentCount(expression)
|
||||||
if (argumentsCount == descriptor.valueParameters.size)
|
if (argumentsCount == descriptor.valueParameters.size)
|
||||||
return expression
|
return expression
|
||||||
val (desc, params) = parametersForCall(expression)
|
val (descriptorForCall, params) = parametersForCall(expression)
|
||||||
return IrDelegatingConstructorCallImpl(
|
return IrDelegatingConstructorCallImpl(
|
||||||
startOffset = expression.startOffset,
|
startOffset = expression.startOffset,
|
||||||
endOffset = expression.endOffset,
|
endOffset = expression.endOffset,
|
||||||
descriptor = desc as ClassConstructorDescriptor)
|
descriptor = descriptorForCall as ClassConstructorDescriptor)
|
||||||
.apply {
|
.apply {
|
||||||
params.forEach {
|
params.forEach {
|
||||||
log("call::params@${it.first.index}/${it.first.name.asString()}: ${ir2string(it.second)}")
|
log("call::params@${it.first.index}/${it.first.name.asString()}: ${ir2string(it.second)}")
|
||||||
putValueArgument(it.first.index, it.second)
|
putValueArgument(it.first.index, it.second)
|
||||||
}
|
}
|
||||||
|
dispatchReceiver = expression.dispatchReceiver
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user