From 49aa36b70d49436549f7843cf30f747535774534 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 25 Feb 2021 09:24:39 +0100 Subject: [PATCH] Generate local delegated properties in interface in jvm-default all modes --- .../kotlin/codegen/MemberCodegen.java | 3 +- .../binding/CodegenAnnotatingVisitor.java | 5 ++- .../serialization/JvmSerializerExtension.kt | 2 +- .../FirBlackBoxCodegenTestGenerated.java | 18 ++++++++ .../codegen/DescriptorMetadataSerializer.kt | 9 ++-- .../backend/jvm/lower/InterfaceLowering.kt | 4 +- .../jvm/lower/PropertyReferenceLowering.kt | 5 ++- .../localDelegatedProperties.kt | 26 ++++++++++++ .../localDelegatedProperties.txt | 38 +++++++++++++++++ .../localDelegatedProperties_ir.txt | 41 +++++++++++++++++++ .../localDelegatedProperties.kt | 26 ++++++++++++ .../localDelegatedProperties.txt | 29 +++++++++++++ .../localDelegatedProperties2.kt | 29 +++++++++++++ .../localDelegatedProperties_ir.txt | 30 ++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 18 ++++++++ .../IrBlackBoxCodegenTestGenerated.java | 18 ++++++++ .../LightAnalysisModeTestGenerated.java | 35 +++++++++++----- 17 files changed, 318 insertions(+), 18 deletions(-) create mode 100644 compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt create mode 100644 compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.txt create mode 100644 compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties_ir.txt create mode 100644 compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt create mode 100644 compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.txt create mode 100644 compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt create mode 100644 compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties_ir.txt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java index 46270c55de0..b5a930e127c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java @@ -660,7 +660,8 @@ public abstract class MemberCodegen delegatedProperties = bindingContext.get(CodegenBinding.DELEGATED_PROPERTIES_WITH_METADATA, thisAsmType); if (delegatedProperties == null || delegatedProperties.isEmpty()) return; - v.newField(NO_ORIGIN, ACC_STATIC | ACC_FINAL | ACC_SYNTHETIC, JvmAbi.DELEGATED_PROPERTIES_ARRAY_NAME, + int additionalFlags = context.getContextKind() != OwnerKind.DEFAULT_IMPLS && isInterface(context.getContextDescriptor()) ? ACC_PUBLIC : 0; + v.newField(NO_ORIGIN, ACC_STATIC | ACC_FINAL | ACC_SYNTHETIC | additionalFlags, JvmAbi.DELEGATED_PROPERTIES_ARRAY_NAME, "[" + K_PROPERTY_TYPE, null, null); if (!state.getClassBuilderMode().generateBodies) return; diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java index ebd8be89fcc..02b9f06c863 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt; import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.codegen.when.SwitchCodegenProvider; import org.jetbrains.kotlin.codegen.when.WhenByEnumsMapping; +import org.jetbrains.kotlin.config.JvmDefaultMode; import org.jetbrains.kotlin.config.LanguageFeature; import org.jetbrains.kotlin.config.LanguageVersionSettings; import org.jetbrains.kotlin.coroutines.CoroutineUtilKt; @@ -87,6 +88,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { private final LanguageVersionSettings languageVersionSettings; private final ClassBuilderMode classBuilderMode; private final DelegatedPropertiesCodegenHelper delegatedPropertiesCodegenHelper; + private final JvmDefaultMode jvmDefaultMode; public CodegenAnnotatingVisitor(@NotNull GenerationState state) { this.bindingTrace = state.getBindingTrace(); @@ -97,6 +99,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { this.languageVersionSettings = state.getLanguageVersionSettings(); this.classBuilderMode = state.getClassBuilderMode(); this.delegatedPropertiesCodegenHelper = new DelegatedPropertiesCodegenHelper(state); + jvmDefaultMode = state.getJvmDefaultMode(); } @NotNull @@ -585,7 +588,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { } return AsmUtil.asmTypeByClassId( - DescriptorUtils.isInterface(descriptor) + DescriptorUtils.isInterface(descriptor) && !jvmDefaultMode.getForAllMethodsWithBody() ? classId.createNestedClassId(Name.identifier(JvmAbi.DEFAULT_IMPLS_CLASS_NAME)) : classId ); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.kt index 16da0103cff..09d7469d516 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/serialization/JvmSerializerExtension.kt @@ -91,7 +91,7 @@ class JvmSerializerExtension @JvmOverloads constructor( } //TODO: support local delegated properties in new defaults scheme val containerAsmType = - if (isInterface(descriptor)) typeMapper.mapDefaultImpls(descriptor) else typeMapper.mapClass(descriptor) + if (isInterface(descriptor) && !jvmDefaultMode.forAllMethodsWithBody) typeMapper.mapDefaultImpls(descriptor) else typeMapper.mapClass(descriptor) writeLocalProperties(proto, containerAsmType, JvmProtoBuf.classLocalVariable) writeVersionRequirementForJvmDefaultIfNeeded(descriptor, proto, versionRequirementTable) diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 709b079fa9a..6fb3b107b04 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -21996,6 +21996,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/kt42674.kt"); } + @Test + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt"); + } + @Test @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { @@ -22330,6 +22336,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/kt42674.kt"); } + @Test + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt"); + } + + @Test + @TestMetadata("localDelegatedProperties2.kt") + public void testLocalDelegatedProperties2() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt"); + } + @Test @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorMetadataSerializer.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorMetadataSerializer.kt index dd5b8500938..1cb1a5bca1a 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorMetadataSerializer.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorMetadataSerializer.kt @@ -44,9 +44,12 @@ class DescriptorMetadataSerializer( if (localDelegatedProperties != null && localDelegatedProperties.isNotEmpty()) { context.state.bindingTrace.record( CodegenBinding.DELEGATED_PROPERTIES_WITH_METADATA, - // When serializing metadata for interfaces, `JvmSerializerExtension.serializeClass` - // looks at `$DefaultImpls` for some reason that's probably related to the old backend. - if (irClass.isInterface) context.typeMapper.mapClass(context.cachedDeclarations.getDefaultImplsClass(irClass)) else type, + // key for local delegated properties metadata in interfaces depends on jvmDefaultMode + if (irClass.isInterface && !context.state.jvmDefaultMode.forAllMethodsWithBody) context.typeMapper.mapClass( + context.cachedDeclarations.getDefaultImplsClass( + irClass + ) + ) else type, localDelegatedProperties.mapNotNull { (it.owner.metadata as? DescriptorMetadataSource.LocalDelegatedProperty)?.descriptor } ) } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt index 2fd5719d2f3..0f018ddd711 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt @@ -161,7 +161,9 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran // Move $$delegatedProperties array and $assertionsDisabled field for (field in irClass.declarations.filterIsInstance()) { - if (field.origin != JvmLoweredDeclarationOrigin.GENERATED_PROPERTY_REFERENCE && field.origin != JvmLoweredDeclarationOrigin.GENERATED_ASSERTION_ENABLED_FIELD) + if ((jvmDefaultMode.forAllMethodsWithBody || field.origin != JvmLoweredDeclarationOrigin.GENERATED_PROPERTY_REFERENCE) && + field.origin != JvmLoweredDeclarationOrigin.GENERATED_ASSERTION_ENABLED_FIELD + ) continue irClass.declarations.remove(field) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertyReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertyReferenceLowering.kt index 085d81cc9ff..9885be40fdb 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertyReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertyReferenceLowering.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.isInlineClassFieldGetter import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.builders.* @@ -41,6 +42,7 @@ import org.jetbrains.kotlin.ir.types.typeWith import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.load.java.JavaDescriptorVisibilities import org.jetbrains.kotlin.load.java.JvmAbi +import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.types.Variance @@ -191,7 +193,8 @@ private class PropertyReferenceLowering(val context: JvmBackendContext) : IrElem origin = JvmLoweredDeclarationOrigin.GENERATED_PROPERTY_REFERENCE isFinal = true isStatic = true - visibility = JavaDescriptorVisibilities.PACKAGE_VISIBILITY + visibility = + if (irClass.isInterface && context.state.jvmDefaultMode.forAllMethodsWithBody) DescriptorVisibilities.PUBLIC else JavaDescriptorVisibilities.PACKAGE_VISIBILITY } val localProperties = mutableListOf() diff --git a/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt b/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt new file mode 100644 index 00000000000..2e636aaf555 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt @@ -0,0 +1,26 @@ +// CHECK_BYTECODE_LISTING +// !JVM_DEFAULT_MODE: all-compatibility +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// WITH_REFLECT +import kotlin.reflect.KProperty + + +class Delegate { + operator fun getValue(t: Any?, p: KProperty<*>): String { + return p.returnType.toString() + } +} + +interface Foo { + + fun test(): String { + val OK by Delegate() + return OK + } +} + +fun box(): String { + return if (object : Foo {}.test() != "kotlin.String") "fail" else "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.txt b/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.txt new file mode 100644 index 00000000000..998f3b6e138 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.txt @@ -0,0 +1,38 @@ +@kotlin.Metadata +public final class Delegate { + // source: 'localDelegatedProperties.kt' + public method (): void + public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): java.lang.String +} + +@kotlin.Metadata +public final class Foo$DefaultImpls { + // source: 'localDelegatedProperties.kt' + public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Foo): java.lang.String + public final inner class Foo$DefaultImpls +} + +@kotlin.Metadata +public interface Foo { + // source: 'localDelegatedProperties.kt' + public synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] + static method (): void + public synthetic static method access$test$jd(p0: Foo): java.lang.String + public @org.jetbrains.annotations.NotNull method test(): java.lang.String + public final inner class Foo$DefaultImpls +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt$box$1 { + // source: 'localDelegatedProperties.kt' + enclosing method LocalDelegatedPropertiesKt.box()Ljava/lang/String; + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + method (): void +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt { + // source: 'localDelegatedProperties.kt' + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String +} diff --git a/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties_ir.txt b/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties_ir.txt new file mode 100644 index 00000000000..9f11b34ee9f --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties_ir.txt @@ -0,0 +1,41 @@ +@kotlin.Metadata +public final class Delegate { + // source: 'localDelegatedProperties.kt' + public method (): void + public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): java.lang.String +} + +@kotlin.Metadata +public final class Foo$DefaultImpls { + // source: 'localDelegatedProperties.kt' + private deprecated static @java.lang.Deprecated method test$lambda-0(p0: Delegate): java.lang.String + public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Foo): java.lang.String + public final inner class Foo$DefaultImpls +} + +@kotlin.Metadata +public interface Foo { + // source: 'localDelegatedProperties.kt' + public synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] + static method (): void + public synthetic static method access$test$jd(p0: Foo): java.lang.String + public synthetic static method access$test$lambda-0(p0: Delegate): java.lang.String + private static method test$lambda-0(p0: Delegate): java.lang.String + public @org.jetbrains.annotations.NotNull method test(): java.lang.String + public final inner class Foo$DefaultImpls +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt$box$1 { + // source: 'localDelegatedProperties.kt' + enclosing method LocalDelegatedPropertiesKt.box()Ljava/lang/String; + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + method (): void +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt { + // source: 'localDelegatedProperties.kt' + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String +} diff --git a/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt new file mode 100644 index 00000000000..743c56371c7 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt @@ -0,0 +1,26 @@ +// CHECK_BYTECODE_LISTING +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 + +// WITH_REFLECT +import kotlin.reflect.KProperty + + +class Delegate { + operator fun getValue(t: Any?, p: KProperty<*>): String { + return p.returnType.toString() + } +} + +interface Foo { + + fun test(): String { + val OK by Delegate() + return OK + } +} + +fun box(): String { + return if (object : Foo {}.test() != "kotlin.String") "fail" else "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.txt b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.txt new file mode 100644 index 00000000000..ebe48c962f4 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.txt @@ -0,0 +1,29 @@ +@kotlin.Metadata +public final class Delegate { + // source: 'localDelegatedProperties.kt' + public method (): void + public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): java.lang.String +} + +@kotlin.Metadata +public interface Foo { + // source: 'localDelegatedProperties.kt' + public synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] + static method (): void + public @org.jetbrains.annotations.NotNull method test(): java.lang.String +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt$box$1 { + // source: 'localDelegatedProperties.kt' + enclosing method LocalDelegatedPropertiesKt.box()Ljava/lang/String; + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + method (): void +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt { + // source: 'localDelegatedProperties.kt' + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String +} diff --git a/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt new file mode 100644 index 00000000000..b6f4ed5a4f5 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt @@ -0,0 +1,29 @@ +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 + +import kotlin.reflect.KProperty + +class Delegate { + operator fun getValue(t: Any?, p: KProperty<*>): String = p.name +} + +interface Foo { + + fun test(): String { + val O by Delegate() + return O + } +} + +interface Foo2: Foo { + + override fun test(): String { + val K by Delegate() + return super.test() + K + } +} + +fun box(): String { + return object : Foo2 {}.test() +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties_ir.txt b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties_ir.txt new file mode 100644 index 00000000000..ab60212ceb1 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties_ir.txt @@ -0,0 +1,30 @@ +@kotlin.Metadata +public final class Delegate { + // source: 'localDelegatedProperties.kt' + public method (): void + public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): java.lang.String +} + +@kotlin.Metadata +public interface Foo { + // source: 'localDelegatedProperties.kt' + public synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] + static method (): void + private static method test$lambda-0(p0: Delegate): java.lang.String + public @org.jetbrains.annotations.NotNull method test(): java.lang.String +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt$box$1 { + // source: 'localDelegatedProperties.kt' + enclosing method LocalDelegatedPropertiesKt.box()Ljava/lang/String; + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + method (): void +} + +@kotlin.Metadata +public final class LocalDelegatedPropertiesKt { + // source: 'localDelegatedProperties.kt' + inner (anonymous) class LocalDelegatedPropertiesKt$box$1 + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 91bb8592ae5..ccd5737fa04 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -21996,6 +21996,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/kt42674.kt"); } + @Test + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt"); + } + @Test @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { @@ -22330,6 +22336,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/kt42674.kt"); } + @Test + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt"); + } + + @Test + @TestMetadata("localDelegatedProperties2.kt") + public void testLocalDelegatedProperties2() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt"); + } + @Test @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 3c9896e6392..896f8b3168d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -21996,6 +21996,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/kt42674.kt"); } + @Test + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt"); + } + @Test @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { @@ -22330,6 +22336,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/kt42674.kt"); } + @Test + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt"); + } + + @Test + @TestMetadata("localDelegatedProperties2.kt") + public void testLocalDelegatedProperties2() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt"); + } + @Test @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 21ab3effd43..72b51693871 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -7522,11 +7522,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/coroutines/featureIntersection/funInterface.kt"); } - @TestMetadata("jvmDefault.kt") - public void ignoreJvmDefault() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt"); - } - private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -7570,6 +7565,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt"); } + @TestMetadata("jvmDefault.kt") + public void testJvmDefault() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt"); + } + @TestMetadata("overrideInInlineClass.kt") public void testOverrideInInlineClass() throws Exception { runTest("compiler/testData/codegen/box/coroutines/featureIntersection/overrideInInlineClass.kt"); @@ -18378,6 +18378,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class AllCompatibility extends AbstractLightAnalysisModeTest { + @TestMetadata("privateSuspend.kt") + public void ignorePrivateSuspend() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/privateSuspend.kt"); + } + @TestMetadata("suspendFunction.kt") public void ignoreSuspendFunction() throws Exception { runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/suspendFunction.kt"); @@ -18516,16 +18521,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/kt42674.kt"); } + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/localDelegatedProperties.kt"); + } + @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/privateFunInInterface.kt"); } - @TestMetadata("privateSuspend.kt") - public void testPrivateSuspend() throws Exception { - runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/privateSuspend.kt"); - } - @TestMetadata("propertyAnnotation.kt") public void testPropertyAnnotation() throws Exception { runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/propertyAnnotation.kt"); @@ -18808,6 +18813,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/kt42674.kt"); } + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties.kt"); + } + + @TestMetadata("localDelegatedProperties2.kt") + public void testLocalDelegatedProperties2() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/localDelegatedProperties2.kt"); + } + @TestMetadata("privateFunInInterface.kt") public void testPrivateFunInInterface() throws Exception { runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/privateFunInInterface.kt");