Properly map super calls in typeMapper

This commit is contained in:
Michael Bogdanov
2016-09-28 11:06:27 +03:00
parent 5f1f4a067d
commit c19e035f91
3 changed files with 36 additions and 2 deletions
@@ -659,12 +659,12 @@ public class KotlinTypeMapper {
baseMethodDescriptor = findBaseDeclaration(functionDescriptor).getOriginal();
ClassDescriptor ownerForDefault = (ClassDescriptor) baseMethodDescriptor.getContainingDeclaration();
ownerForDefaultImpl =
isJvmInterface(ownerForDefault) && (state == null || !isJvm8Interface(ownerForDefault, state)) ?
isJvmInterface(ownerForDefault) && !isJvm8Interface(ownerForDefault) ?
mapDefaultImpls(ownerForDefault) : mapClass(ownerForDefault);
if (isInterface && (superCall || descriptor.getVisibility() == Visibilities.PRIVATE || isAccessor(descriptor))) {
thisClass = mapClass(currentOwner);
if (declarationOwner instanceof JavaClassDescriptor) {
if (declarationOwner instanceof JavaClassDescriptor || isJvm8Interface(declarationOwner)) {
invokeOpcode = INVOKESPECIAL;
signature = mapSignatureSkipGeneric(functionDescriptor);
owner = thisClass;
@@ -743,6 +743,10 @@ public class KotlinTypeMapper {
thisClass, receiverParameterType, calleeType);
}
private boolean isJvm8Interface(@NotNull ClassDescriptor ownerForDefault) {
return isJvmInterface(ownerForDefault) && (state != null && JvmCodegenUtil.isJvm8Interface(ownerForDefault, state));
}
public static boolean isAccessor(@NotNull CallableMemberDescriptor descriptor) {
return descriptor instanceof AccessorForCallableDescriptor<?>;
}