JVM KT-36984 SAM wrappers are anonymous inner classes

This commit is contained in:
Dmitry Petrov
2020-12-18 14:27:53 +03:00
parent 57dd9fc87a
commit 0dff583070
14 changed files with 107 additions and 14 deletions
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.codegen.inline.SourceMapper;
import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper; import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.codegen.state.TypeMapperUtilsKt; import org.jetbrains.kotlin.codegen.state.TypeMapperUtilsKt;
import org.jetbrains.kotlin.config.JvmDefaultMode;
import org.jetbrains.kotlin.config.LanguageFeature; import org.jetbrains.kotlin.config.LanguageFeature;
import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl; import org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl;
@@ -83,7 +84,9 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
private final MemberCodegen<?> parentCodegen; private final MemberCodegen<?> parentCodegen;
private final ReifiedTypeParametersUsages reifiedTypeParametersUsages = new ReifiedTypeParametersUsages(); private final ReifiedTypeParametersUsages reifiedTypeParametersUsages = new ReifiedTypeParametersUsages();
private final Collection<ClassDescriptor> innerClasses = new LinkedHashSet<>(); private final Collection<ClassDescriptor> innerClasses = new LinkedHashSet<>();
private final Collection<SyntheticInnerClassInfo> syntheticInnerClasses = new LinkedHashSet<>();
private ExpressionCodegen clInit; private ExpressionCodegen clInit;
private NameGenerator inlineNameGenerator; private NameGenerator inlineNameGenerator;
@@ -316,6 +319,10 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
genClassOrObject(context, descriptor.getSyntheticDeclaration(), state, this, descriptor); genClassOrObject(context, descriptor.getSyntheticDeclaration(), state, this, descriptor);
} }
public void addSyntheticAnonymousInnerClass(SyntheticInnerClassInfo syntheticInnerClassInfo) {
syntheticInnerClasses.add(syntheticInnerClassInfo);
}
private void writeInnerClasses() { private void writeInnerClasses() {
// JVMS7 (4.7.6): a nested class or interface member will have InnerClasses information // JVMS7 (4.7.6): a nested class or interface member will have InnerClasses information
// for each enclosing class and for each immediate member // for each enclosing class and for each immediate member
@@ -331,6 +338,9 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
for (ClassDescriptor innerClass : innerClasses) { for (ClassDescriptor innerClass : innerClasses) {
writeInnerClass(innerClass); writeInnerClass(innerClass);
} }
for (SyntheticInnerClassInfo syntheticInnerClass : syntheticInnerClasses) {
v.visitInnerClass(syntheticInnerClass.getInternalName(), null, null, syntheticInnerClass.getFlags());
}
} }
protected void addParentsToInnerClassesIfNeeded(@NotNull Collection<ClassDescriptor> innerClasses) { protected void addParentsToInnerClassesIfNeeded(@NotNull Collection<ClassDescriptor> innerClasses) {
@@ -376,18 +386,12 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
} }
protected void writeOuterClassAndEnclosingMethod() { protected void writeOuterClassAndEnclosingMethod() {
CodegenContext context = this.context.getParentContext(); CodegenContext<?> context = getNonInlineOuterContext(this.context.getParentContext());
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();
}
assert context != null : "Outermost context can't be null: " + this.context; 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) { if (enclosingAsmType != null) {
Method method = computeEnclosingMethod(context); Method method = computeEnclosingMethod(typeMapper, context);
v.visitOuterClass( v.visitOuterClass(
enclosingAsmType.getInternalName(), enclosingAsmType.getInternalName(),
@@ -397,15 +401,31 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
} }
} }
public static CodegenContext<?> 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 @Nullable
private Type computeOuterClass(@NotNull CodegenContext<?> context) { public static Type computeOuterClass(
@NotNull KotlinTypeMapper typeMapper,
@NotNull JvmDefaultMode jvmDefaultMode,
@NotNull KtPureElement element,
@NotNull CodegenContext<?> context
) {
CodegenContext<? extends ClassOrPackageFragmentDescriptor> outermost = context.getClassOrPackageParentContext(); CodegenContext<? extends ClassOrPackageFragmentDescriptor> outermost = context.getClassOrPackageParentContext();
if (outermost instanceof ClassContext) { if (outermost instanceof ClassContext) {
ClassDescriptor classDescriptor = ((ClassContext) outermost).getContextDescriptor(); ClassDescriptor classDescriptor = ((ClassContext) outermost).getContextDescriptor();
if (context instanceof MethodContext) { if (context instanceof MethodContext) {
FunctionDescriptor functionDescriptor = ((MethodContext) context).getFunctionDescriptor(); FunctionDescriptor functionDescriptor = ((MethodContext) context).getFunctionDescriptor();
if (isInterface(functionDescriptor.getContainingDeclaration()) && !JvmAnnotationUtilKt if (isInterface(functionDescriptor.getContainingDeclaration()) &&
.isCompiledToJvmDefault(functionDescriptor, state.getJvmDefaultMode())) { !JvmAnnotationUtilKt.isCompiledToJvmDefault(functionDescriptor, jvmDefaultMode)
) {
return typeMapper.mapDefaultImpls(classDescriptor); return typeMapper.mapDefaultImpls(classDescriptor);
} }
} }
@@ -425,7 +445,7 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
} }
@Nullable @Nullable
private Method computeEnclosingMethod(@NotNull CodegenContext context) { public static Method computeEnclosingMethod(@NotNull KotlinTypeMapper typeMapper, @NotNull CodegenContext context) {
if (context instanceof MethodContext) { if (context instanceof MethodContext) {
FunctionDescriptor functionDescriptor = ((MethodContext) context).getFunctionDescriptor(); FunctionDescriptor functionDescriptor = ((MethodContext) context).getFunctionDescriptor();
if ("<clinit>".equals(functionDescriptor.getName().asString())) { if ("<clinit>".equals(functionDescriptor.getName().asString())) {
@@ -20,6 +20,8 @@ import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.backend.common.CodegenUtil; import org.jetbrains.kotlin.backend.common.CodegenUtil;
import org.jetbrains.kotlin.codegen.context.ClassContext; 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.GenerationState;
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper; import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.*;
@@ -62,6 +64,7 @@ public class SamWrapperCodegen {
private final SamType samType; private final SamType samType;
private final MemberCodegen<?> parentCodegen; private final MemberCodegen<?> parentCodegen;
private final int visibility; private final int visibility;
private final int classFlags;
public static final String SAM_WRAPPER_SUFFIX = "$0"; public static final String SAM_WRAPPER_SUFFIX = "$0";
public SamWrapperCodegen( public SamWrapperCodegen(
@@ -76,6 +79,7 @@ public class SamWrapperCodegen {
this.samType = samType; this.samType = samType;
this.parentCodegen = parentCodegen; this.parentCodegen = parentCodegen;
visibility = isInsideInline ? ACC_PUBLIC : NO_FLAG_PACKAGE_PRIVATE; visibility = isInsideInline ? ACC_PUBLIC : NO_FLAG_PACKAGE_PRIVATE;
classFlags = visibility | ACC_FINAL | ACC_SUPER;
} }
@NotNull @NotNull
@@ -121,7 +125,7 @@ public class SamWrapperCodegen {
cv.defineClass( cv.defineClass(
file, file,
state.getClassFileVersion(), state.getClassFileVersion(),
ACC_FINAL | ACC_SUPER | visibility, classFlags,
asmType.getInternalName(), asmType.getInternalName(),
null, null,
OBJECT_TYPE.getInternalName(), OBJECT_TYPE.getInternalName(),
@@ -131,6 +135,8 @@ public class SamWrapperCodegen {
WriteAnnotationUtilKt.writeSyntheticClassMetadata(cv, state); WriteAnnotationUtilKt.writeSyntheticClassMetadata(cv, state);
generateInnerClassInformation(file, asmType, cv);
// e.g. ASM type for Function2 // e.g. ASM type for Function2
Type functionAsmType = typeMapper.mapType(functionType); Type functionAsmType = typeMapper.mapType(functionType);
@@ -160,6 +166,24 @@ public class SamWrapperCodegen {
return asmType; 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) { private void generateConstructor(Type ownerType, Type functionType, ClassBuilder cv) {
MethodVisitor mv = cv.newMethod(JvmDeclarationOriginKt.OtherOrigin(samType.getClassDescriptor()), MethodVisitor mv = cv.newMethod(JvmDeclarationOriginKt.OtherOrigin(samType.getClassDescriptor()),
visibility, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, functionType), null, null); visibility, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, functionType), null, null);
@@ -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)
@@ -23,7 +23,9 @@ final class<null> TKt$sam$Sam$0 {
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
public <null> method getFunctionDelegate(): kotlin.Function public <null> method getFunctionDelegate(): kotlin.Function
public <null> method hashCode(): int public <null> method hashCode(): int
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -33,4 +35,5 @@ public final class<null> TKt {
public final static <<T:Ljava/lang/Object;>()TT;> method genericSam(): java.lang.Object public final static <<T:Ljava/lang/Object;>()TT;> method genericSam(): java.lang.Object
public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object
inner (anonymous) class TKt$genericSam$1 inner (anonymous) class TKt$genericSam$1
inner (anonymous) class TKt$sam$Sam$0
} }
@@ -14,7 +14,9 @@ final class<null> TKt$sam$Sam$0 {
// source: 't.kt' // source: 't.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -23,4 +25,5 @@ public final class<null> TKt {
public final static <<T:Ljava/lang/Object;>()TT;> method foo(): java.lang.Object public final static <<T:Ljava/lang/Object;>()TT;> method foo(): java.lang.Object
public final static <<T:Ljava/lang/Object;>()TT;> method genericSam(): java.lang.Object public final static <<T:Ljava/lang/Object;>()TT;> method genericSam(): java.lang.Object
inner (anonymous) class TKt$genericSam$1 inner (anonymous) class TKt$genericSam$1
inner (anonymous) class TKt$sam$Sam$0
} }
@@ -12,7 +12,9 @@ final class<null> TKt$sam$Sam$0 {
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
public <null> method getFunctionDelegate(): kotlin.Function public <null> method getFunctionDelegate(): kotlin.Function
public <null> method hashCode(): int public <null> method hashCode(): int
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -33,5 +35,6 @@ public final class<null> TKt {
public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object
public final static @org.jetbrains.annotations.NotNull <null> method foo(): java.lang.String public final static @org.jetbrains.annotations.NotNull <null> method foo(): java.lang.String
public final static @org.jetbrains.annotations.NotNull <null> method specializedSam(): java.lang.String public final static @org.jetbrains.annotations.NotNull <null> method specializedSam(): java.lang.String
inner (anonymous) class TKt$sam$Sam$0
inner (anonymous) class TKt$specializedSam$1 inner (anonymous) class TKt$specializedSam$1
} }
@@ -3,7 +3,9 @@ final class<null> TKt$sam$Sam$0 {
// source: 't.kt' // source: 't.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -23,5 +25,6 @@ public final class<null> TKt {
// source: 't.kt' // source: 't.kt'
public final static @org.jetbrains.annotations.NotNull <null> method foo(): java.lang.String public final static @org.jetbrains.annotations.NotNull <null> method foo(): java.lang.String
public final static @org.jetbrains.annotations.NotNull <null> method specializedSam(): java.lang.String public final static @org.jetbrains.annotations.NotNull <null> method specializedSam(): java.lang.String
inner (anonymous) class TKt$sam$Sam$0
inner (anonymous) class TKt$specializedSam$1 inner (anonymous) class TKt$specializedSam$1
} }
@@ -12,7 +12,9 @@ final class<null> TKt$sam$Sam$0 {
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
public <null> method getFunctionDelegate(): kotlin.Function public <null> method getFunctionDelegate(): kotlin.Function
public <null> method hashCode(): int public <null> method hashCode(): int
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -20,4 +22,5 @@ public final class<null> TKt {
// source: 't.kt' // source: 't.kt'
public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object
public final static <<T:Ljava/lang/Object;>(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object public final static <<T:Ljava/lang/Object;>(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
} }
@@ -3,11 +3,14 @@ final class<null> TKt$sam$Sam$0 {
// source: 't.kt' // source: 't.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
public final class<null> TKt { public final class<null> TKt {
// source: 't.kt' // source: 't.kt'
public final static <<T:Ljava/lang/Object;>(Lkotlin/jvm/functions/Function0<+TT;>;)TT;> method genericSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object public final static <<T:Ljava/lang/Object;>(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
} }
@@ -13,7 +13,9 @@ final class F1Kt$getWrapped1$f$1 {
@kotlin.Metadata @kotlin.Metadata
final class F1Kt$sam$java_lang_Runnable$0 { final class F1Kt$sam$java_lang_Runnable$0 {
// source: 'f1.kt' // source: 'f1.kt'
enclosing class F1Kt
private synthetic final field function: kotlin.jvm.functions.Function0 private synthetic final field function: kotlin.jvm.functions.Function0
inner (anonymous) class F1Kt$sam$java_lang_Runnable$0
method <init>(p0: kotlin.jvm.functions.Function0): void method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final method run(): void public synthetic final method run(): void
} }
@@ -22,6 +24,7 @@ final class F1Kt$sam$java_lang_Runnable$0 {
public final class F1Kt { public final class F1Kt {
// source: 'f1.kt' // source: 'f1.kt'
inner (anonymous) class F1Kt$getWrapped1$f$1 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 public final static @org.jetbrains.annotations.NotNull method getWrapped1(): java.lang.Runnable
} }
@@ -40,7 +43,9 @@ final class F2Kt$getWrapped2$f$1 {
@kotlin.Metadata @kotlin.Metadata
final class F2Kt$sam$java_lang_Runnable$0 { final class F2Kt$sam$java_lang_Runnable$0 {
// source: 'f2.kt' // source: 'f2.kt'
enclosing class F2Kt
private synthetic final field function: kotlin.jvm.functions.Function0 private synthetic final field function: kotlin.jvm.functions.Function0
inner (anonymous) class F2Kt$sam$java_lang_Runnable$0
method <init>(p0: kotlin.jvm.functions.Function0): void method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final method run(): void public synthetic final method run(): void
} }
@@ -49,13 +54,16 @@ final class F2Kt$sam$java_lang_Runnable$0 {
public final class F2Kt { public final class F2Kt {
// source: 'f2.kt' // source: 'f2.kt'
inner (anonymous) class F2Kt$getWrapped2$f$1 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 public final static @org.jetbrains.annotations.NotNull method getWrapped2(): java.lang.Runnable
} }
@kotlin.Metadata @kotlin.Metadata
final class TestKt$sam$java_lang_Runnable$0 { final class TestKt$sam$java_lang_Runnable$0 {
// source: 'test.kt' // source: 'test.kt'
enclosing class TestKt
private synthetic final field function: kotlin.jvm.functions.Function0 private synthetic final field function: kotlin.jvm.functions.Function0
inner (anonymous) class TestKt$sam$java_lang_Runnable$0
method <init>(p0: kotlin.jvm.functions.Function0): void method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final method run(): void public synthetic final method run(): void
} }
@@ -75,6 +83,7 @@ final class TestKt$test1$f$1 {
@kotlin.Metadata @kotlin.Metadata
public final class TestKt { public final class TestKt {
// source: 'test.kt' // source: 'test.kt'
inner (anonymous) class TestKt$sam$java_lang_Runnable$0
inner (anonymous) class TestKt$test1$f$1 inner (anonymous) class TestKt$test1$f$1
public final static method test1(): void public final static method test1(): void
public final static method test2(): void public final static method test2(): void
@@ -3,7 +3,9 @@ public final class<null> test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnabl
// source: 'samAdapterAndInlinedOne.kt' // source: 'samAdapterAndInlinedOne.kt'
public <null> method <init>(p0: kotlin.jvm.functions.Function0): void public <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method run(): void public synthetic final <null> method run(): void
enclosing class test/SamAdapterAndInlinedOneKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnable$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -11,7 +13,9 @@ final class<null> test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0 {
// source: 'samAdapterAndInlinedOne.kt' // source: 'samAdapterAndInlinedOne.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method run(): void public synthetic final <null> method run(): void
enclosing class test/SamAdapterAndInlinedOneKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -21,4 +25,6 @@ public final class<null> test/SamAdapterAndInlinedOneKt {
public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0<Lkotlin/Unit;>;)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<Lkotlin/Unit;>;)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<Lkotlin/Unit;>;)Ljava/lang/Runnable;> method noInline2(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0<Lkotlin/Unit;>;)Ljava/lang/Runnable;> method noInline2(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable
public synthetic final static <<T:Ljava/lang/Object;>(Lkotlin/jvm/functions/Function0<Lkotlin/Unit;>;)Ljava/lang/Runnable;> method makeRunnable(p0: kotlin.jvm.functions.Function0): java.lang.Runnable public synthetic final static <<T:Ljava/lang/Object;>(Lkotlin/jvm/functions/Function0<Lkotlin/Unit;>;)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
} }
@@ -12,7 +12,9 @@ final class<null> TKt$sam$Sam$0 {
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
public <null> method getFunctionDelegate(): kotlin.Function public <null> method getFunctionDelegate(): kotlin.Function
public <null> method hashCode(): int public <null> method hashCode(): int
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
@@ -20,4 +22,5 @@ public final class<null> TKt {
// source: 't.kt' // source: 't.kt'
public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String
public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object public final static <<T:Ljava/lang/Object;>(LSam<TT;>;)TT;> method expectsSam(@org.jetbrains.annotations.NotNull p0: Sam): java.lang.Object
inner (anonymous) class TKt$sam$Sam$0
} }
@@ -3,11 +3,14 @@ final class<null> TKt$sam$Sam$0 {
// source: 't.kt' // source: 't.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method get(): java.lang.Object public synthetic final <null> method get(): java.lang.Object
enclosing class TKt
private synthetic final field <null> function: kotlin.jvm.functions.Function0 private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
} }
@kotlin.Metadata @kotlin.Metadata
public final class<null> TKt { public final class<null> TKt {
// source: 't.kt' // source: 't.kt'
public final static <(Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String public final static <(Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;)Ljava/lang/String;> method specializedSam(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.String
inner (anonymous) class TKt$sam$Sam$0
} }
@@ -61,7 +61,9 @@ public final class B$runnable2$1 {
@kotlin.Metadata @kotlin.Metadata
public final class B$sam$i$java_lang_Runnable$0 { public final class B$sam$i$java_lang_Runnable$0 {
// source: 'wrapperInlinedFromAnotherClass.kt' // source: 'wrapperInlinedFromAnotherClass.kt'
enclosing class B
private synthetic final field function: kotlin.jvm.functions.Function0 private synthetic final field function: kotlin.jvm.functions.Function0
inner (anonymous) class B$sam$i$java_lang_Runnable$0
public method <init>(p0: kotlin.jvm.functions.Function0): void public method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final method run(): void public synthetic final method run(): void
} }