diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 470c8f124cc..ccd8d550001 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -1305,7 +1305,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { for (Map.Entry entry : CodegenUtil.getNonPrivateTraitMethods(descriptor).entrySet()) { FunctionDescriptor interfaceFun = entry.getKey(); //skip java 8 default methods - if (!CodegenUtilKt.isDefinitelyNotDefaultImplsMethod(interfaceFun)) { + if (!CodegenUtilKt.isDefinitelyNotDefaultImplsMethod(interfaceFun) && !isJvm8InterfaceMember(interfaceFun, state)) { generateDelegationToDefaultImpl(interfaceFun, entry.getValue()); } } diff --git a/compiler/testData/codegen/java8/box/jvm8/diamond.kt b/compiler/testData/codegen/java8/box/jvm8/diamond.kt index 2b921508e3d..139cc6f3f30 100644 --- a/compiler/testData/codegen/java8/box/jvm8/diamond.kt +++ b/compiler/testData/codegen/java8/box/jvm8/diamond.kt @@ -31,10 +31,9 @@ class TestClass2 : TestClass(), Test3 { fun box(): String { val test = TestClass2().test() if (test != "Test2") return "fail 1: $test" - // TODO: enable this test once the required behavior is specified -// checkNoMethod(TestClass::class.java, "test") -// checkNoMethod(Test3::class.java, "test") -// checkNoMethod(TestClass2::class.java, "test") + checkNoMethod(TestClass::class.java, "test") + checkNoMethod(Test3::class.java, "test") + checkNoMethod(TestClass2::class.java, "test") return "OK" } diff --git a/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInClass.kt b/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInClass.kt index 49b069cd786..03c811f4a24 100644 --- a/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInClass.kt +++ b/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInClass.kt @@ -11,13 +11,11 @@ class TestClass : Test { } fun box(): String { - // TODO: enable this test once the required behavior is specified -// try { -// TestClass::class.java.getDeclaredMethod("test") -// } -// catch (e: NoSuchMethodException) { -// return "OK" -// } -// return "fail" - return "OK" + try { + TestClass::class.java.getDeclaredMethod("test") + } + catch (e: NoSuchMethodException) { + return "OK" + } + return "fail" } diff --git a/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface.kt b/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface.kt index 0fb65ae3445..477e82dfdcb 100644 --- a/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface.kt +++ b/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface.kt @@ -11,13 +11,11 @@ interface Test2 : Test { } fun box(): String { - // TODO: enable this test once the required behavior is specified -// try { -// Test2::class.java.getDeclaredMethod("test") -// } -// catch (e: NoSuchMethodException) { -// return "OK" -// } -// return "fail" - return "OK" + try { + Test2::class.java.getDeclaredMethod("test") + } + catch (e: NoSuchMethodException) { + return "OK" + } + return "fail" } diff --git a/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface2.kt b/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface2.kt index 13f6048127d..149d822cefa 100644 --- a/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface2.kt +++ b/compiler/testData/codegen/java8/box/jvm8/noDelegation/noDelegationToDefaultMethodInInterface2.kt @@ -16,13 +16,11 @@ interface Test3 : Test2 { } fun box(): String { - // TODO: enable this test once the required behavior is specified -// try { -// Test3::class.java.getDeclaredMethod("test") -// } -// catch (e: NoSuchMethodException) { -// return "OK" -// } -// return "fail" - return "OK" + try { + Test3::class.java.getDeclaredMethod("test") + } + catch (e: NoSuchMethodException) { + return "OK" + } + return "fail" } diff --git a/compiler/testData/codegen/java8/compileKotlinAgainstKotlin/jvm8against6/delegation/delegationToDefaultMethodInInterface.kt b/compiler/testData/codegen/java8/compileKotlinAgainstKotlin/jvm8against6/delegation/delegationToDefaultMethodInInterface.kt index 6df0806ed97..2877b012b1c 100644 --- a/compiler/testData/codegen/java8/compileKotlinAgainstKotlin/jvm8against6/delegation/delegationToDefaultMethodInInterface.kt +++ b/compiler/testData/codegen/java8/compileKotlinAgainstKotlin/jvm8against6/delegation/delegationToDefaultMethodInInterface.kt @@ -1,6 +1,3 @@ -// WITH_REFLECT -// FULL_JDK - // FILE: 1.kt interface Test { fun test() {