diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CallableMethod.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/CallableMethod.kt index ef1c6f9f15e..bad19c172b0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CallableMethod.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CallableMethod.kt @@ -29,7 +29,8 @@ class CallableMethod( override val generateCalleeType: Type?, override val returnKotlinType: KotlinType?, val isInterfaceMethod: Boolean, - private val isDefaultMethodInInterface: Boolean + private val isDefaultMethodInInterface: Boolean, + private val boxInlineClassBeforeInvoke: Boolean ) : Callable { private val defaultImplMethod: Method by lazy(LazyThreadSafetyMode.PUBLICATION, computeDefaultMethod) @@ -49,6 +50,9 @@ class CallableMethod( get() = getAsmMethod().argumentTypes override fun genInvokeInstruction(v: InstructionAdapter) { + if (boxInlineClassBeforeInvoke) { + StackValue.boxInlineClass(dispatchReceiverKotlinType!!, v) + } v.visitMethodInsn( invokeOpcode, owner.internalName, diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt index d490572bc3c..f9324d61432 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt @@ -379,7 +379,8 @@ class KotlinTypeMapper @JvmOverloads constructor( val originalDescriptor = descriptor.original return CallableMethod( owner, owner, { mapDefaultMethod(originalDescriptor, OwnerKind.IMPLEMENTATION) }, method, INVOKESPECIAL, - null, null, null, null, null, originalDescriptor.returnType, isInterfaceMethod = false, isDefaultMethodInInterface = false + null, null, null, null, null, originalDescriptor.returnType, isInterfaceMethod = false, isDefaultMethodInInterface = false, + boxInlineClassBeforeInvoke = false ) } @@ -402,6 +403,7 @@ class KotlinTypeMapper @JvmOverloads constructor( val dispatchReceiverKotlinType: KotlinType? var isInterfaceMember = false var isDefaultMethodInInterface = false + var boxInlineClassBeforeInvoke = false if (functionParent is ClassDescriptor) { val declarationFunctionDescriptor = findAnyDeclaration(functionDescriptor) @@ -452,11 +454,15 @@ class KotlinTypeMapper @JvmOverloads constructor( functionDescriptor = descriptor } - val isStaticInvocation = - isStaticDeclaration(functionDescriptor) && functionDescriptor !is ImportedFromObjectCallableDescriptor<*> || - isStaticAccessor(functionDescriptor) || - functionDescriptor.isJvmStaticInObjectOrClassOrInterface() || - toInlinedErasedClass + val isFakeOverrideOfJvmDefault = toInlinedErasedClass && + functionDescriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE && + functionDescriptor.overridesJvmDefault() + + val isStaticInvocation = !isFakeOverrideOfJvmDefault && + (isStaticDeclaration(functionDescriptor) && functionDescriptor !is ImportedFromObjectCallableDescriptor<*> || + isStaticAccessor(functionDescriptor) || + functionDescriptor.isJvmStaticInObjectOrClassOrInterface() || + toInlinedErasedClass) when { isStaticInvocation -> { invokeOpcode = INVOKESTATIC @@ -466,8 +472,13 @@ class KotlinTypeMapper @JvmOverloads constructor( invokeOpcode = INVOKEINTERFACE isInterfaceMember = true } + isFakeOverrideOfJvmDefault -> { + invokeOpcode = INVOKEVIRTUAL + boxInlineClassBeforeInvoke = true + } else -> { - val isPrivateFunInvocation = DescriptorVisibilities.isPrivate(functionDescriptor.visibility) && !functionDescriptor.isSuspend + val isPrivateFunInvocation = + DescriptorVisibilities.isPrivate(functionDescriptor.visibility) && !functionDescriptor.isSuspend invokeOpcode = if (superCall || isPrivateFunInvocation) INVOKESPECIAL else INVOKEVIRTUAL isInterfaceMember = false } @@ -479,7 +490,7 @@ class KotlinTypeMapper @JvmOverloads constructor( else functionDescriptor.original - signature = if (toInlinedErasedClass) + signature = if (toInlinedErasedClass && !isFakeOverrideOfJvmDefault) mapSignatureForInlineErasedClassSkipGeneric(functionToCall) else mapSignature( @@ -547,10 +558,18 @@ class KotlinTypeMapper @JvmOverloads constructor( signature, invokeOpcode, thisClass, dispatchReceiverKotlinType, receiverParameterType, extensionReceiverKotlinType, calleeType, returnKotlinType, if (jvmTarget >= JvmTarget.JVM_1_8) isInterfaceMember else invokeOpcode == INVOKEINTERFACE, - isDefaultMethodInInterface + isDefaultMethodInInterface, boxInlineClassBeforeInvoke ) } + private fun CallableMemberDescriptor.overridesJvmDefault(): Boolean { + if (kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) { + return overriddenDescriptors.any { it.overridesJvmDefault() } + } + if (isCompiledToJvmDefault(jvmDefaultMode)) return true + return (containingDeclaration as? JavaClassDescriptor)?.kind == ClassKind.INTERFACE && modality != Modality.ABSTRACT + } + fun mapFunctionName(descriptor: FunctionDescriptor, kind: OwnerKind?): String { if (descriptor !is JavaCallableMemberDescriptor) { val platformName = getJvmName(descriptor) diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 85fd78ff175..27b1a4b67fd 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -15235,6 +15235,26 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testJvmDefaultEnableProperty() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt"); } + + @TestMetadata("jvmDefaultGeneric.kt") + public void testJvmDefaultGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt"); + } + + @TestMetadata("jvmDefaultSafeCall.kt") + public void testJvmDefaultSafeCall() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt"); + } + + @TestMetadata("jvmDefaultSmartCast.kt") + public void testJvmDefaultSmartCast() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt"); + } + + @TestMetadata("jvmDefaultSuspend.kt") + public void testJvmDefaultSuspend() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt"); + } } @TestMetadata("compiler/testData/codegen/box/inlineClasses/propertyDelegation") diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt index c0cfa2a8fee..5ac8bf8e81f 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt @@ -1,7 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // JVM_TARGET: 1.8 // FILE: javaDefaultMethod.kt inline class K(val k: String) : J { diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt index 02ac7ea6202..841caea6370 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt @@ -1,7 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // JVM_TARGET: 1.8 // FILE: javaDefaultMethod.kt interface K2 : J { diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt index 3c40e5857ee..982fd903f4b 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt @@ -1,8 +1,5 @@ // !JVM_DEFAULT_MODE: all // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // WITH_RUNTIME // JVM_TARGET: 1.8 // FILE: jvmDefaultAll.kt diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt index 0258f121629..60c3c31c0b9 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt @@ -1,8 +1,5 @@ // !JVM_DEFAULT_MODE: all // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // WITH_RUNTIME // JVM_TARGET: 1.8 // FILE: jvmDefaultAll.kt diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt index 6932507a332..3e6073335c7 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt @@ -1,8 +1,5 @@ // !JVM_DEFAULT_MODE: all // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // WITH_RUNTIME // JVM_TARGET: 1.8 // FILE: jvmDefaultAll.kt diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt index ab633f270fd..cb5146a2de9 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt @@ -1,8 +1,5 @@ // !JVM_DEFAULT_MODE: enable // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // WITH_RUNTIME // JVM_TARGET: 1.8 // FILE: jvmDefaultEnable.kt diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt index c89f86e2d83..61f78c66454 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt @@ -1,8 +1,5 @@ // !JVM_DEFAULT_MODE: enable // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // WITH_RUNTIME // JVM_TARGET: 1.8 // FILE: jvmDefaultEnable.kt diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt index 3e04523b893..7259e2d0952 100644 --- a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt @@ -1,8 +1,5 @@ // !JVM_DEFAULT_MODE: enable // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND: JVM -// ^ KT-43698, fixed in JVM_IR // WITH_RUNTIME // JVM_TARGET: 1.8 // FILE: jvmDefaultEnable.kt diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt new file mode 100644 index 00000000000..968baae4f5a --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt @@ -0,0 +1,16 @@ +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// JVM_TARGET: 1.8 + +class Cell(val x: T) + +interface IOk { + fun ok(): String = "OK" +} + +inline class InlineClass(val s: String) : IOk + +fun test(cell: Cell): String = cell.x.ok() + +fun box() = test(Cell(InlineClass("FAIL"))) diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt new file mode 100644 index 00000000000..eb88d38a2f7 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt @@ -0,0 +1,14 @@ +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// JVM_TARGET: 1.8 + +interface IOk { + fun ok(): String = "OK" +} + +inline class InlineClass(val s: String) : IOk + +fun test(x: InlineClass?) = x?.ok() ?: "Failed" + +fun box() = test(InlineClass("")) diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt new file mode 100644 index 00000000000..9dbb31e7c3a --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt @@ -0,0 +1,16 @@ +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// JVM_TARGET: 1.8 + +interface IOk { + fun ok(): String = "OK" +} + +inline class InlineClass(val s: String) : IOk + +fun test(x: Any): String { + return if (x is InlineClass) x.ok() else "FAIL" +} + +fun box() = test(InlineClass("Dummy")) diff --git a/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt new file mode 100644 index 00000000000..883bb3b447b --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt @@ -0,0 +1,28 @@ +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// JVM_TARGET: 1.8 + +import kotlin.coroutines.* + +interface IOk { + fun ok(): String = "OK" +} + +inline class InlineClass(val s: String) : IOk + +suspend fun returnsUnboxed() = InlineClass("") + +suspend fun test(): String = returnsUnboxed().ok() + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(Continuation(EmptyCoroutineContext) {}) +} + +fun box(): String { + var res = "FAIL" + builder { + res = test() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt b/compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt index 41c38966dc0..c6e344b8c4b 100644 --- a/compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt +++ b/compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt @@ -1,9 +1,5 @@ // !LANGUAGE: +InlineClasses // IGNORE_BACKEND_FIR: JVM_IR - -// IGNORE_BACKEND: JVM -// The JVM backend does not generate the g-impl method, but ends up calling it from box. - // !JVM_DEFAULT_MODE: enable // JVM_TARGET: 1.8 // FILE: test.kt diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 6e341c7966e..c1bae21017f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -16635,6 +16635,26 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testJvmDefaultEnableProperty() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt"); } + + @TestMetadata("jvmDefaultGeneric.kt") + public void testJvmDefaultGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt"); + } + + @TestMetadata("jvmDefaultSafeCall.kt") + public void testJvmDefaultSafeCall() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt"); + } + + @TestMetadata("jvmDefaultSmartCast.kt") + public void testJvmDefaultSmartCast() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt"); + } + + @TestMetadata("jvmDefaultSuspend.kt") + public void testJvmDefaultSuspend() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt"); + } } @TestMetadata("compiler/testData/codegen/box/inlineClasses/propertyDelegation") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 75f5751ca61..3ac4543710b 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16588,46 +16588,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Jvm8DefaultInterfaceMethods extends AbstractLightAnalysisModeTest { - @TestMetadata("javaDefaultMethod.kt") - public void ignoreJavaDefaultMethod() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt"); - } - - @TestMetadata("javaDefaultMethodOverriddenByKotlin.kt") - public void ignoreJavaDefaultMethodOverriddenByKotlin() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt"); - } - - @TestMetadata("jvmDefaultAll.kt") - public void ignoreJvmDefaultAll() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt"); - } - - @TestMetadata("jvmDefaultAllPrimaryProperty.kt") - public void ignoreJvmDefaultAllPrimaryProperty() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt"); - } - - @TestMetadata("jvmDefaultAllProperty.kt") - public void ignoreJvmDefaultAllProperty() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt"); - } - - @TestMetadata("jvmDefaultEnable.kt") - public void ignoreJvmDefaultEnable() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt"); - } - - @TestMetadata("jvmDefaultEnablePrimaryProperty.kt") - public void ignoreJvmDefaultEnablePrimaryProperty() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt"); - } - - @TestMetadata("jvmDefaultEnableProperty.kt") - public void ignoreJvmDefaultEnableProperty() throws Exception { - runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt"); - } - private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -16635,6 +16595,66 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testAllFilesPresentInJvm8DefaultInterfaceMethods() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + + @TestMetadata("javaDefaultMethod.kt") + public void testJavaDefaultMethod() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt"); + } + + @TestMetadata("javaDefaultMethodOverriddenByKotlin.kt") + public void testJavaDefaultMethodOverriddenByKotlin() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethodOverriddenByKotlin.kt"); + } + + @TestMetadata("jvmDefaultAll.kt") + public void testJvmDefaultAll() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAll.kt"); + } + + @TestMetadata("jvmDefaultAllPrimaryProperty.kt") + public void testJvmDefaultAllPrimaryProperty() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllPrimaryProperty.kt"); + } + + @TestMetadata("jvmDefaultAllProperty.kt") + public void testJvmDefaultAllProperty() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultAllProperty.kt"); + } + + @TestMetadata("jvmDefaultEnable.kt") + public void testJvmDefaultEnable() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnable.kt"); + } + + @TestMetadata("jvmDefaultEnablePrimaryProperty.kt") + public void testJvmDefaultEnablePrimaryProperty() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnablePrimaryProperty.kt"); + } + + @TestMetadata("jvmDefaultEnableProperty.kt") + public void testJvmDefaultEnableProperty() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt"); + } + + @TestMetadata("jvmDefaultGeneric.kt") + public void testJvmDefaultGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt"); + } + + @TestMetadata("jvmDefaultSafeCall.kt") + public void testJvmDefaultSafeCall() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt"); + } + + @TestMetadata("jvmDefaultSmartCast.kt") + public void testJvmDefaultSmartCast() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt"); + } + + @TestMetadata("jvmDefaultSuspend.kt") + public void testJvmDefaultSuspend() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt"); + } } @TestMetadata("compiler/testData/codegen/box/inlineClasses/propertyDelegation") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index fb4fe1cefd9..ac5cbfb6d24 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -15235,6 +15235,26 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testJvmDefaultEnableProperty() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultEnableProperty.kt"); } + + @TestMetadata("jvmDefaultGeneric.kt") + public void testJvmDefaultGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultGeneric.kt"); + } + + @TestMetadata("jvmDefaultSafeCall.kt") + public void testJvmDefaultSafeCall() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSafeCall.kt"); + } + + @TestMetadata("jvmDefaultSmartCast.kt") + public void testJvmDefaultSmartCast() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSmartCast.kt"); + } + + @TestMetadata("jvmDefaultSuspend.kt") + public void testJvmDefaultSuspend() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/jvmDefaultSuspend.kt"); + } } @TestMetadata("compiler/testData/codegen/box/inlineClasses/propertyDelegation")