Fix bug in local declarations lowering

IrCall doesn't provide `.shallowCopy` now, so the unreachable buggy code
became reachable.
This commit is contained in:
Svyatoslav Scherbina
2017-05-04 13:15:03 +03:00
committed by SvyatoslavScherbina
parent 0b1e7c9526
commit 68e6ff614d
@@ -402,13 +402,13 @@ class LocalDeclarationsLowering(val context: BackendContext) : DeclarationContai
)
private fun remapTypeArguments(oldExpression: IrMemberAccessExpression, newCallee: CallableDescriptor): Map<TypeParameterDescriptor, KotlinType>? {
val oldCallee = oldExpression.descriptor
val oldCallee = oldExpression.descriptor.original
return if (oldCallee.typeParameters.isEmpty())
null
else oldCallee.typeParameters.associateBy(
{ newCallee.typeParameters[it.index] },
{ oldExpression.getTypeArgument(it)!! }
{ oldExpression.getTypeArgumentOrDefault(it) }
)
}