Dump class structure in a test that has an object in a lambda
This commit is contained in:
@@ -859,7 +859,7 @@ class MethodInliner(
|
|||||||
needReification: Boolean,
|
needReification: Boolean,
|
||||||
capturesAnonymousObjectThatMustBeRegenerated: Boolean
|
capturesAnonymousObjectThatMustBeRegenerated: Boolean
|
||||||
): AnonymousObjectTransformationInfo {
|
): AnonymousObjectTransformationInfo {
|
||||||
// In objects inside non-default lambdas, all reified type parameters are free (not from the function
|
// In objects inside non-default inline lambdas, all reified type parameters are free (not from the function
|
||||||
// we're inlining into) so there's nothing to reify:
|
// we're inlining into) so there's nothing to reify:
|
||||||
//
|
//
|
||||||
// inline fun <reified T> f(x: () -> KClass<T> = { { T::class }() }) = x()
|
// inline fun <reified T> f(x: () -> KClass<T> = { { T::class }() }) = x()
|
||||||
@@ -867,8 +867,8 @@ class MethodInliner(
|
|||||||
// fun b() = f<Int> { { Int::class }() } // non-default lambda
|
// fun b() = f<Int> { { Int::class }() } // non-default lambda
|
||||||
// inline fun <reified V> c() = f<V> { { V::class }() }
|
// inline fun <reified V> c() = f<V> { { V::class }() }
|
||||||
//
|
//
|
||||||
// -- in a(), the default lambda captures T so a regeneration is needed; but in b() and c(), the non-default
|
// -- in a(), the default inline lambda captures T so a regeneration is needed; but in b() and c(), the non-default
|
||||||
// lambda cannot possibly reference it, while V is not yet bound so regenerating the object while inlining
|
// inline lambda cannot possibly reference it, while V is not yet bound so regenerating the object while inlining
|
||||||
// the lambda into f() is pointless.
|
// the lambda into f() is pointless.
|
||||||
val inNonDefaultLambda = inliningContext.isInliningLambda && inliningContext.lambdaInfo !is DefaultLambda
|
val inNonDefaultLambda = inliningContext.isInliningLambda && inliningContext.lambdaInfo !is DefaultLambda
|
||||||
val info = AnonymousObjectTransformationInfo(
|
val info = AnonymousObjectTransformationInfo(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// CHECK_BYTECODE_LISTING
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
package test
|
package test
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public final class _2Kt$box$$inlined$complicatedCast$1 {
|
||||||
|
inner class _2Kt$box$$inlined$complicatedCast$1
|
||||||
|
public method <init>(): void
|
||||||
|
public final method f(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class _2Kt$complicatedCast$1$1 {
|
||||||
|
inner class _2Kt$complicatedCast$1$1
|
||||||
|
public method <init>(): void
|
||||||
|
public final method f(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class _2Kt {
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||||
|
public synthetic final static method complicatedCast(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class test/_1Kt {
|
||||||
|
public final static method myRun(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public final class _2Kt$box$$inlined$complicatedCast$1 {
|
||||||
|
inner class _2Kt$box$$inlined$complicatedCast$1
|
||||||
|
public method <init>(): void
|
||||||
|
public final method f(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class _2Kt$complicatedCast$1$1 {
|
||||||
|
inner class _2Kt$complicatedCast$1$1
|
||||||
|
public method <init>(): void
|
||||||
|
public final method f(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class _2Kt {
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||||
|
public synthetic final static method complicatedCast(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class test/_1Kt {
|
||||||
|
public final static method myRun(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): java.lang.Object
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user