From 0dff583070e74dcb533b2b7a7842a5c242df7905 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Fri, 18 Dec 2020 14:27:53 +0300 Subject: [PATCH] JVM KT-36984 SAM wrappers are anonymous inner classes --- .../kotlin/codegen/MemberCodegen.java | 46 +++++++++++++------ .../kotlin/codegen/SamWrapperCodegen.java | 26 ++++++++++- .../kotlin/codegen/SyntheticInnerClassInfo.kt | 8 ++++ .../sam/callableRefGenericFunInterface.txt | 3 ++ .../sam/callableRefGenericSamInterface.txt | 3 ++ .../callableRefSpecializedFunInterface.txt | 3 ++ .../callableRefSpecializedSamInterface.txt | 3 ++ .../sam/genericFunInterface.txt | 3 ++ .../sam/genericSamInterface.txt | 3 ++ .../sam/reusedSamWrapperClasses.txt | 9 ++++ .../sam/samAdapterAndInlinedOne.txt | 6 +++ .../sam/specializedFunInterface.txt | 3 ++ .../sam/specializedSamInterface.txt | 3 ++ .../sam/wrapperInlinedFromAnotherClass.txt | 2 + 14 files changed, 107 insertions(+), 14 deletions(-) create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticInnerClassInfo.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java index 7c45a18cef8..46270c55de0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.codegen.inline.SourceMapper; import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper; import org.jetbrains.kotlin.codegen.state.TypeMapperUtilsKt; +import org.jetbrains.kotlin.config.JvmDefaultMode; import org.jetbrains.kotlin.config.LanguageFeature; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl; @@ -83,7 +84,9 @@ public abstract class MemberCodegen parentCodegen; private final ReifiedTypeParametersUsages reifiedTypeParametersUsages = new ReifiedTypeParametersUsages(); + private final Collection innerClasses = new LinkedHashSet<>(); + private final Collection syntheticInnerClasses = new LinkedHashSet<>(); private ExpressionCodegen clInit; private NameGenerator inlineNameGenerator; @@ -316,6 +319,10 @@ public abstract class MemberCodegen innerClasses) { @@ -376,18 +386,12 @@ public abstract class MemberCodegen context = getNonInlineOuterContext(this.context.getParentContext()); assert context != null : "Outermost context can't be null: " + this.context; - Type enclosingAsmType = computeOuterClass(context); + Type enclosingAsmType = computeOuterClass(typeMapper, state.getJvmDefaultMode(), element, context); if (enclosingAsmType != null) { - Method method = computeEnclosingMethod(context); + Method method = computeEnclosingMethod(typeMapper, context); v.visitOuterClass( enclosingAsmType.getInternalName(), @@ -397,15 +401,31 @@ public abstract class MemberCodegen getNonInlineOuterContext(CodegenContext parentContext) { + CodegenContext context = parentContext; + while (context instanceof InlineLambdaContext) { + // If this is a lambda which will be inlined, skip its MethodContext and enclosing ClosureContext + //noinspection ConstantConditions + context = context.getParentContext().getParentContext(); + } + return context; + } + @Nullable - private Type computeOuterClass(@NotNull CodegenContext context) { + public static Type computeOuterClass( + @NotNull KotlinTypeMapper typeMapper, + @NotNull JvmDefaultMode jvmDefaultMode, + @NotNull KtPureElement element, + @NotNull CodegenContext context + ) { CodegenContext outermost = context.getClassOrPackageParentContext(); if (outermost instanceof ClassContext) { ClassDescriptor classDescriptor = ((ClassContext) outermost).getContextDescriptor(); if (context instanceof MethodContext) { FunctionDescriptor functionDescriptor = ((MethodContext) context).getFunctionDescriptor(); - if (isInterface(functionDescriptor.getContainingDeclaration()) && !JvmAnnotationUtilKt - .isCompiledToJvmDefault(functionDescriptor, state.getJvmDefaultMode())) { + if (isInterface(functionDescriptor.getContainingDeclaration()) && + !JvmAnnotationUtilKt.isCompiledToJvmDefault(functionDescriptor, jvmDefaultMode) + ) { return typeMapper.mapDefaultImpls(classDescriptor); } } @@ -425,7 +445,7 @@ public abstract class MemberCodegen".equals(functionDescriptor.getName().asString())) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java index 5a62089be3f..9c204d64ffb 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java @@ -20,6 +20,8 @@ import kotlin.text.StringsKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.backend.common.CodegenUtil; import org.jetbrains.kotlin.codegen.context.ClassContext; +import org.jetbrains.kotlin.codegen.context.CodegenContext; +import org.jetbrains.kotlin.codegen.context.FieldOwnerContext; import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper; import org.jetbrains.kotlin.descriptors.*; @@ -62,6 +64,7 @@ public class SamWrapperCodegen { private final SamType samType; private final MemberCodegen parentCodegen; private final int visibility; + private final int classFlags; public static final String SAM_WRAPPER_SUFFIX = "$0"; public SamWrapperCodegen( @@ -76,6 +79,7 @@ public class SamWrapperCodegen { this.samType = samType; this.parentCodegen = parentCodegen; visibility = isInsideInline ? ACC_PUBLIC : NO_FLAG_PACKAGE_PRIVATE; + classFlags = visibility | ACC_FINAL | ACC_SUPER; } @NotNull @@ -121,7 +125,7 @@ public class SamWrapperCodegen { cv.defineClass( file, state.getClassFileVersion(), - ACC_FINAL | ACC_SUPER | visibility, + classFlags, asmType.getInternalName(), null, OBJECT_TYPE.getInternalName(), @@ -131,6 +135,8 @@ public class SamWrapperCodegen { WriteAnnotationUtilKt.writeSyntheticClassMetadata(cv, state); + generateInnerClassInformation(file, asmType, cv); + // e.g. ASM type for Function2 Type functionAsmType = typeMapper.mapType(functionType); @@ -160,6 +166,24 @@ public class SamWrapperCodegen { return asmType; } + private void generateInnerClassInformation(@NotNull KtFile file, Type asmType, ClassBuilder cv) { + parentCodegen.addSyntheticAnonymousInnerClass(new SyntheticInnerClassInfo(asmType.getInternalName(), classFlags)); + FieldOwnerContext parentContext = parentCodegen.context; + CodegenContext outerContext = MemberCodegen.getNonInlineOuterContext(parentContext); + assert outerContext != null : + "Outer context for SAM wrapper " + asmType.getInternalName() + " is null, parentContext:" + parentContext; + Type outerClassType = MemberCodegen.computeOuterClass(state.getTypeMapper(), state.getJvmDefaultMode(), file, outerContext); + assert outerClassType != null : + "Outer class for SAM wrapper " + asmType.getInternalName() + " is null, parentContext:" + parentContext; + Method enclosingMethod = MemberCodegen.computeEnclosingMethod(state.getTypeMapper(), outerContext); + cv.visitOuterClass( + outerClassType.getInternalName(), + enclosingMethod == null ? null : enclosingMethod.getName(), + enclosingMethod == null ? null : enclosingMethod.getDescriptor() + ); + cv.visitInnerClass(asmType.getInternalName(), null, null, classFlags); + } + private void generateConstructor(Type ownerType, Type functionType, ClassBuilder cv) { MethodVisitor mv = cv.newMethod(JvmDeclarationOriginKt.OtherOrigin(samType.getClassDescriptor()), visibility, "", Type.getMethodDescriptor(Type.VOID_TYPE, functionType), null, null); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticInnerClassInfo.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticInnerClassInfo.kt new file mode 100644 index 00000000000..c17cb165052 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticInnerClassInfo.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.codegen + +data class SyntheticInnerClassInfo(val internalName: String, val flags: Int) \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.txt index 1206f0318fa..43b745b330f 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericFunInterface.txt @@ -23,7 +23,9 @@ final class TKt$sam$Sam$0 { public synthetic final method get(): java.lang.Object public method getFunctionDelegate(): kotlin.Function public method hashCode(): int + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata @@ -33,4 +35,5 @@ public final class TKt { public final static <()TT;> method genericSam(): java.lang.Object public final static <(LSam;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object inner (anonymous) class TKt$genericSam$1 + inner (anonymous) class TKt$sam$Sam$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.txt index 84937e9c843..03ec0d56cf6 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefGenericSamInterface.txt @@ -14,7 +14,9 @@ final class TKt$sam$Sam$0 { // source: 't.kt' method (p0: kotlin.jvm.functions.Function0): void public synthetic final method get(): java.lang.Object + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata @@ -23,4 +25,5 @@ public final class TKt { public final static <()TT;> method foo(): java.lang.Object public final static <()TT;> method genericSam(): java.lang.Object inner (anonymous) class TKt$genericSam$1 + inner (anonymous) class TKt$sam$Sam$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.txt index 9a609621556..ba3956bdcc3 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedFunInterface.txt @@ -12,7 +12,9 @@ final class TKt$sam$Sam$0 { public synthetic final method get(): java.lang.Object public method getFunctionDelegate(): kotlin.Function public method hashCode(): int + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata @@ -33,5 +35,6 @@ public final class TKt { public final static <(LSam;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object public final static @org.jetbrains.annotations.NotNull method foo(): java.lang.String public final static @org.jetbrains.annotations.NotNull method specializedSam(): java.lang.String + inner (anonymous) class TKt$sam$Sam$0 inner (anonymous) class TKt$specializedSam$1 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.txt index 9bd3589ccdd..2102c82f6e1 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.txt @@ -3,7 +3,9 @@ final class TKt$sam$Sam$0 { // source: 't.kt' method (p0: kotlin.jvm.functions.Function0): void public synthetic final method get(): java.lang.Object + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata @@ -23,5 +25,6 @@ public final class TKt { // source: 't.kt' public final static @org.jetbrains.annotations.NotNull method foo(): java.lang.String public final static @org.jetbrains.annotations.NotNull method specializedSam(): java.lang.String + inner (anonymous) class TKt$sam$Sam$0 inner (anonymous) class TKt$specializedSam$1 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.txt index af2dd62d6a2..ddf6ef8d381 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/genericFunInterface.txt @@ -12,7 +12,9 @@ final class TKt$sam$Sam$0 { public synthetic final method get(): java.lang.Object public method getFunctionDelegate(): kotlin.Function public method hashCode(): int + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata @@ -20,4 +22,5 @@ public final class TKt { // source: 't.kt' public final static <(LSam;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object public final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object + inner (anonymous) class TKt$sam$Sam$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.txt index febf11f0f65..efb77081001 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/genericSamInterface.txt @@ -3,11 +3,14 @@ final class TKt$sam$Sam$0 { // source: 't.kt' method (p0: kotlin.jvm.functions.Function0): void public synthetic final method get(): java.lang.Object + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata public final class TKt { // source: 't.kt' public final static <(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object + inner (anonymous) class TKt$sam$Sam$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.txt b/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.txt index 53ad99ef69d..d2db69c4cc3 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/reusedSamWrapperClasses.txt @@ -13,7 +13,9 @@ final class F1Kt$getWrapped1$f$1 { @kotlin.Metadata final class F1Kt$sam$java_lang_Runnable$0 { // source: 'f1.kt' + enclosing class F1Kt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class F1Kt$sam$java_lang_Runnable$0 method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void } @@ -22,6 +24,7 @@ final class F1Kt$sam$java_lang_Runnable$0 { public final class F1Kt { // source: 'f1.kt' inner (anonymous) class F1Kt$getWrapped1$f$1 + inner (anonymous) class F1Kt$sam$java_lang_Runnable$0 public final static @org.jetbrains.annotations.NotNull method getWrapped1(): java.lang.Runnable } @@ -40,7 +43,9 @@ final class F2Kt$getWrapped2$f$1 { @kotlin.Metadata final class F2Kt$sam$java_lang_Runnable$0 { // source: 'f2.kt' + enclosing class F2Kt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class F2Kt$sam$java_lang_Runnable$0 method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void } @@ -49,13 +54,16 @@ final class F2Kt$sam$java_lang_Runnable$0 { public final class F2Kt { // source: 'f2.kt' inner (anonymous) class F2Kt$getWrapped2$f$1 + inner (anonymous) class F2Kt$sam$java_lang_Runnable$0 public final static @org.jetbrains.annotations.NotNull method getWrapped2(): java.lang.Runnable } @kotlin.Metadata final class TestKt$sam$java_lang_Runnable$0 { // source: 'test.kt' + enclosing class TestKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TestKt$sam$java_lang_Runnable$0 method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void } @@ -75,6 +83,7 @@ final class TestKt$test1$f$1 { @kotlin.Metadata public final class TestKt { // source: 'test.kt' + inner (anonymous) class TestKt$sam$java_lang_Runnable$0 inner (anonymous) class TestKt$test1$f$1 public final static method test1(): void public final static method test2(): void diff --git a/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.txt b/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.txt index 81039b208ed..70908a67f5f 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.txt @@ -3,7 +3,9 @@ public final class test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnabl // source: 'samAdapterAndInlinedOne.kt' public method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void + enclosing class test/SamAdapterAndInlinedOneKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnable$0 } @kotlin.Metadata @@ -11,7 +13,9 @@ final class test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0 { // source: 'samAdapterAndInlinedOne.kt' method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void + enclosing class test/SamAdapterAndInlinedOneKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0 } @kotlin.Metadata @@ -21,4 +25,6 @@ public final class test/SamAdapterAndInlinedOneKt { public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0;)Ljava/lang/Runnable;> method noInline(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0;)Ljava/lang/Runnable;> method noInline2(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable public synthetic final static <(Lkotlin/jvm/functions/Function0;)Ljava/lang/Runnable;> method makeRunnable(p0: kotlin.jvm.functions.Function0): java.lang.Runnable + inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnable$0 + inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.txt index 6edd416e201..310988b9a98 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.txt @@ -12,7 +12,9 @@ final class TKt$sam$Sam$0 { public synthetic final method get(): java.lang.Object public method getFunctionDelegate(): kotlin.Function public method hashCode(): int + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata @@ -20,4 +22,5 @@ public final class TKt { // source: 't.kt' public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String public final static <(LSam;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object + inner (anonymous) class TKt$sam$Sam$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.txt b/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.txt index c52afa8868a..3bb5239d280 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/specializedSamInterface.txt @@ -3,11 +3,14 @@ final class TKt$sam$Sam$0 { // source: 't.kt' method (p0: kotlin.jvm.functions.Function0): void public synthetic final method get(): java.lang.Object + enclosing class TKt private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class TKt$sam$Sam$0 } @kotlin.Metadata public final class TKt { // source: 't.kt' public final static <(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String + inner (anonymous) class TKt$sam$Sam$0 } diff --git a/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.txt b/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.txt index 82d63cbff51..902a3dba8a5 100644 --- a/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.txt +++ b/compiler/testData/codegen/bytecodeListing/sam/wrapperInlinedFromAnotherClass.txt @@ -61,7 +61,9 @@ public final class B$runnable2$1 { @kotlin.Metadata public final class B$sam$i$java_lang_Runnable$0 { // source: 'wrapperInlinedFromAnotherClass.kt' + enclosing class B private synthetic final field function: kotlin.jvm.functions.Function0 + inner (anonymous) class B$sam$i$java_lang_Runnable$0 public method (p0: kotlin.jvm.functions.Function0): void public synthetic final method run(): void }