Files
kotlin-fork/compiler/testData/codegen/bytecodeListing/sam/samAdapterAndInlinedOne.txt
T
Alexander Udalov 628d75c7cd JVM: fix EnclosingMethod information for SAMs in inline lambdas
Pass parentContext to SamWrapperCodegen from the outside instead of
using the one from parentCodegen. The difference is that in case of an
inline lambda, we're creating an InlineLambdaContext whose parent is a
ClosureContext, but the codegen for that lambda has that latter
ClosureContext as its context. So the getNonInlineOuterContext call in
SamWrapperCodegen.generateInnerClassInformation wasn't able to identify
that this is a context of a lambda that needs to be skipped, and
generated it as EnclosingMethod, which caused Java reflection to fail
because once that lambda was inlined, it was removed and thus didn't
make it to runtime.

 #KT-44827 Fixed
2021-03-09 11:43:11 +01:00

31 lines
2.3 KiB
Plaintext
Vendored

@kotlin.Metadata
public synthetic final class<null> test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnable$0 {
// source: 'samAdapterAndInlinedOne.kt'
public <null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method run(): void
enclosing method test/SamAdapterAndInlinedOneKt.makeRunnable(Lkotlin/jvm/functions/Function0;)Ljava/lang/Runnable;
private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$i$java_lang_Runnable$0
}
@kotlin.Metadata
synthetic final class<null> test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0 {
// source: 'samAdapterAndInlinedOne.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method run(): void
enclosing method test/SamAdapterAndInlinedOneKt.noInline(Lkotlin/jvm/functions/Function0;)Ljava/lang/Runnable;
private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class test/SamAdapterAndInlinedOneKt$sam$java_lang_Runnable$0
}
@kotlin.Metadata
public final class<null> test/SamAdapterAndInlinedOneKt {
// source: 'samAdapterAndInlinedOne.kt'
public final static @org.jetbrains.annotations.NotNull <(Lkotlin/jvm/functions/Function0<Lkotlin/Unit;>;)Ljava/lang/Runnable;> method makeRunnable2(@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 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
}