Files
kotlin-fork/compiler/testData/codegen/bytecodeListing/sam/callableRefSpecializedSamInterface.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
1.3 KiB
Plaintext
Vendored

@kotlin.Metadata
synthetic final class<null> TKt$sam$Sam$0 {
// source: 't.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void
public synthetic final <null> method get(): java.lang.Object
enclosing method TKt.specializedSam()Ljava/lang/String;
private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
}
@kotlin.Metadata
synthetic final class<Lkotlin/jvm/internal/FunctionReferenceImpl;Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;> TKt$specializedSam$1 {
// source: 't.kt'
static <null> method <clinit>(): void
<null> method <init>(): void
public synthetic bridge <null> method invoke(): java.lang.Object
public final @org.jetbrains.annotations.NotNull <null> method invoke(): java.lang.String
enclosing method TKt.specializedSam()Ljava/lang/String;
public final static field <null> INSTANCE: TKt$specializedSam$1
inner (anonymous) class TKt$specializedSam$1
}
@kotlin.Metadata
public final class<null> TKt {
// 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 specializedSam(): java.lang.String
inner (anonymous) class TKt$sam$Sam$0
inner (anonymous) class TKt$specializedSam$1
}