JVM_IR KT-45431 don't optimize out $$delegatedProperties in companion
Corresponding delegates are initialized in the host class, using '$$delegatedProperties'. TODO figure out proper code generation scheme for delegated properties in companions (KT-45580)
This commit is contained in:
committed by
TeamCityServer
parent
f6baabd98e
commit
73d4fa65ea
+20
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class DP {
|
||||
operator fun provideDelegate(t: Any?, kp: KProperty<*>) =
|
||||
lazy { "OK" }
|
||||
}
|
||||
|
||||
class H1 {
|
||||
companion object {
|
||||
val property: String by DP()
|
||||
}
|
||||
}
|
||||
|
||||
class H2 {
|
||||
companion object {
|
||||
val property: String by lazy { "OK" }
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
@kotlin.Metadata
|
||||
final class DP$provideDelegate$1 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
enclosing method DP.provideDelegate(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Lkotlin/Lazy;
|
||||
public final static field INSTANCE: DP$provideDelegate$1
|
||||
inner (anonymous) class DP$provideDelegate$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class DP {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
inner (anonymous) class DP$provideDelegate$1
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): kotlin.Lazy
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H1$Companion {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
||||
static method <clinit>(): void
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String
|
||||
public final inner class H1$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H1 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: H1$Companion
|
||||
private final static @org.jetbrains.annotations.NotNull field property$delegate: kotlin.Lazy
|
||||
static method <clinit>(): void
|
||||
public method <init>(): void
|
||||
public synthetic final static method access$getProperty$cp(): kotlin.Lazy
|
||||
public final inner class H1$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class H2$Companion$property$2 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
enclosing class H2
|
||||
public final static field INSTANCE: H2$Companion$property$2
|
||||
inner (anonymous) class H2$Companion$property$2
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H2$Companion {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String
|
||||
public final inner class H2$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H2 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: H2$Companion
|
||||
private final static @org.jetbrains.annotations.NotNull field property$delegate: kotlin.Lazy
|
||||
inner (anonymous) class H2$Companion$property$2
|
||||
static method <clinit>(): void
|
||||
public method <init>(): void
|
||||
public synthetic final static method access$getProperty$cp(): kotlin.Lazy
|
||||
public final inner class H2$Companion
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
@kotlin.Metadata
|
||||
final class DP$provideDelegate$1 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
enclosing method DP.provideDelegate(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Lkotlin/Lazy;
|
||||
public final static field INSTANCE: DP$provideDelegate$1
|
||||
inner (anonymous) class DP$provideDelegate$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class DP {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
inner (anonymous) class DP$provideDelegate$1
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): kotlin.Lazy
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H1$Companion {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
||||
static method <clinit>(): void
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String
|
||||
public final inner class H1$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H1 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: H1$Companion
|
||||
private final static @org.jetbrains.annotations.NotNull field property$delegate: kotlin.Lazy
|
||||
static method <clinit>(): void
|
||||
public method <init>(): void
|
||||
public synthetic final static method access$getProperty$delegate$cp(): kotlin.Lazy
|
||||
public final inner class H1$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class H2$Companion$property$2 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
enclosing method H2.<clinit>()V
|
||||
public final static field INSTANCE: H2$Companion$property$2
|
||||
inner (anonymous) class H2$Companion$property$2
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H2$Companion {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
||||
static method <clinit>(): void
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String
|
||||
public final inner class H2$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class H2 {
|
||||
// source: 'delegatedPropertiesInCompanionObject.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: H2$Companion
|
||||
private final static @org.jetbrains.annotations.NotNull field property$delegate: kotlin.Lazy
|
||||
inner (anonymous) class H2$Companion$property$2
|
||||
static method <clinit>(): void
|
||||
public method <init>(): void
|
||||
public synthetic final static method access$getProperty$delegate$cp(): kotlin.Lazy
|
||||
public final inner class H2$Companion
|
||||
}
|
||||
Reference in New Issue
Block a user