Fix for KT-15446: Property reference on an instance of subclass causes java.lang.VerifyError

#KT-15446 Fixed
This commit is contained in:
Mikhael Bogdanov
2016-12-29 13:37:59 +01:00
parent ff734ce9ea
commit 043f3199c7
9 changed files with 103 additions and 3 deletions
@@ -256,9 +256,8 @@ class PropertyReferenceCodegen(
}
if (receiverType != null) {
val expectedReceiver = target.dispatchReceiverParameter ?: target.extensionReceiverParameter ?:
throw AssertionError("receiverType: $receiverType; no dispatch or extension receiver: $target")
val expectedReceiverType = typeMapper.mapType(expectedReceiver.type)
val expectedReceiver = target.extensionReceiverParameter?.type ?: (target.containingDeclaration as? ClassDescriptor)?.defaultType
val expectedReceiverType = if (expectedReceiver != null) typeMapper.mapType(expectedReceiver) else receiverType
capturedBoundReferenceReceiver(asmType, expectedReceiverType, isInliningStrategy).put(expectedReceiverType, v)
}
else {