Files
kotlin-fork/compiler/testData/codegen/bytecodeListing/sam/specializedFunInterface.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

27 lines
1.2 KiB
Plaintext
Vendored

@kotlin.Metadata
public interface<<T:Ljava/lang/Object;>Ljava/lang/Object;> Sam {
// source: 't.kt'
public abstract <()TT;> method get(): java.lang.Object
}
@kotlin.Metadata
synthetic final class<null> TKt$sam$Sam$0 {
// source: 't.kt'
<null> method <init>(p0: kotlin.jvm.functions.Function0): void
public <null> method equals(p0: java.lang.Object): boolean
public synthetic final <null> method get(): java.lang.Object
public <null> method getFunctionDelegate(): kotlin.Function
public <null> method hashCode(): int
enclosing method TKt.specializedSam(Lkotlin/jvm/functions/Function0;)Ljava/lang/String;
private synthetic final field <null> function: kotlin.jvm.functions.Function0
inner (anonymous) class TKt$sam$Sam$0
}
@kotlin.Metadata
public final class<null> TKt {
// 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 <<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
}