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

81 lines
3.4 KiB
Plaintext
Vendored

@kotlin.Metadata
final class A$testRunnableSamCtor1$1 {
// source: 'wrapperInlinedFromAnotherClass.kt'
enclosing method A.testRunnableSamCtor1()Ljava/lang/Runnable;
public final static field INSTANCE: A$testRunnableSamCtor1$1
inner (anonymous) class A$testRunnableSamCtor1$1
static method <clinit>(): void
method <init>(): void
public synthetic bridge method invoke(): java.lang.Object
public final method invoke(): void
}
@kotlin.Metadata
final class A$testRunnableSamCtor2$1 {
// source: 'wrapperInlinedFromAnotherClass.kt'
enclosing method A.testRunnableSamCtor2()Ljava/lang/Runnable;
public final static field INSTANCE: A$testRunnableSamCtor2$1
inner (anonymous) class A$testRunnableSamCtor2$1
static method <clinit>(): void
method <init>(): void
public synthetic bridge method invoke(): java.lang.Object
public final method invoke(): void
}
@kotlin.Metadata
public final class A {
// source: 'wrapperInlinedFromAnotherClass.kt'
inner (anonymous) class A$testRunnableSamCtor1$1
inner (anonymous) class A$testRunnableSamCtor2$1
public method <init>(): void
public final @org.jetbrains.annotations.NotNull method test1a(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method test1b(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method test2a(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method test2b(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method testRunnableSamCtor1(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method testRunnableSamCtor2(): java.lang.Runnable
}
@kotlin.Metadata
public final class B$runnable1$1 {
// source: 'wrapperInlinedFromAnotherClass.kt'
enclosing method B.runnable1()Ljava/lang/Runnable;
public final static field INSTANCE: B$runnable1$1
inner (anonymous) class B$runnable1$1
static method <clinit>(): void
public method <init>(): void
public final method run(): void
}
@kotlin.Metadata
public final class B$runnable2$1 {
// source: 'wrapperInlinedFromAnotherClass.kt'
enclosing method B.runnable2()Ljava/lang/Runnable;
public final static field INSTANCE: B$runnable2$1
inner (anonymous) class B$runnable2$1
static method <clinit>(): void
public method <init>(): void
public final method run(): void
}
@kotlin.Metadata
public synthetic final class B$sam$i$java_lang_Runnable$0 {
// source: 'wrapperInlinedFromAnotherClass.kt'
enclosing method B.runnableSamCtor(Lkotlin/jvm/functions/Function0;)Ljava/lang/Runnable;
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 synthetic final method run(): void
}
@kotlin.Metadata
public final class B {
// source: 'wrapperInlinedFromAnotherClass.kt'
inner (anonymous) class B$runnable1$1
inner (anonymous) class B$runnable2$1
public method <init>(): void
public final @org.jetbrains.annotations.NotNull method runnable1(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method runnable2(): java.lang.Runnable
public final @org.jetbrains.annotations.NotNull method runnableSamCtor(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Runnable
}