Properly check default kind on inheriting from old DefaultImpls scheme

This commit is contained in:
Mikhael Bogdanov
2020-10-06 13:10:50 +02:00
parent 714d17ac63
commit 5048471835
9 changed files with 67 additions and 6 deletions
@@ -1679,7 +1679,8 @@ public class FunctionCodegen {
assert isInterface(containingDeclaration) : "'processInterfaceMethod' method should be called only for interfaces, but: " +
containingDeclaration;
if (JvmAnnotationUtilKt.isCompiledToJvmDefault(memberDescriptor, mode)) {
// Fake overrides in interfaces should be expanded to implementation to make proper default check
if (JvmAnnotationUtilKt.checkIsImplementationCompiledToJvmDefault(memberDescriptor, mode)) {
return (kind != OwnerKind.DEFAULT_IMPLS && !isSynthetic) ||
(kind == OwnerKind.DEFAULT_IMPLS &&
(isSynthetic || //TODO: move synthetic method generation into interface