a9343aeb7d
This inconsistency is present due to not using the `// WITH_STDLIB` in the above tests. When K1 creates the enum, it tries to generate `entries()`, and for that it tries to load `kotlin.enums.EnumEntries`, but this is actually an unresolved reference. K1 silently swallows it, and proceeds. The reason K2 doesn't fail is that in order to generate `entries()` it simply creates the necessary `ConeClassLikeType` with the desired `classId` instead of loading the whole `ClassDescriptor`. The reason we can still observe `$ENTRIES` and `$entries` in K1 is because they are generated during the JVM codegen, and it only checks if the `EnumEntries` language feature is supported. It doesn't check if the `entries` property has really existed in IR (by this time it's expected to have already been lowered to the `get-entries` function - that's why "has ... existed"). The reason why the codegen doesn't fail when working with `kotlin.enums.EnumEntries` is because it creates its own `IrClassSymbol`. ^KT-55840 Fixed Merge-request: KT-MR-8727 Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
84 lines
3.8 KiB
Plaintext
Vendored
84 lines
3.8 KiB
Plaintext
Vendored
@java.lang.annotation.Retention(value=RUNTIME)
|
|
@kotlin.Metadata
|
|
public annotation class Ann {
|
|
// source: 'enum.kt'
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public final enum class SimpleEnum {
|
|
// source: 'enum.kt'
|
|
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
|
|
private synthetic final static field $VALUES: SimpleEnum[]
|
|
public final enum static field A: SimpleEnum
|
|
public final enum static field B: SimpleEnum
|
|
public final enum static field C: SimpleEnum
|
|
private synthetic final static method $entries(): SimpleEnum[]
|
|
private synthetic final static method $values(): SimpleEnum[]
|
|
static method <clinit>(): void
|
|
private method <init>(p0: java.lang.String, p1: int): void
|
|
public static @org.jetbrains.annotations.NotNull method getEntries(): kotlin.enums.EnumEntries
|
|
public static method valueOf(p0: java.lang.String): SimpleEnum
|
|
public static method values(): SimpleEnum[]
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public final enum class WithAnnotations {
|
|
// source: 'enum.kt'
|
|
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
|
|
private synthetic final static field $VALUES: WithAnnotations[]
|
|
public final enum static @Ann field A: WithAnnotations
|
|
public final enum static @Ann field B: WithAnnotations
|
|
private synthetic final static method $entries(): WithAnnotations[]
|
|
private synthetic final static method $values(): WithAnnotations[]
|
|
static method <clinit>(): void
|
|
private method <init>(p0: java.lang.String, p1: int): void
|
|
public static @org.jetbrains.annotations.NotNull method getEntries(): kotlin.enums.EnumEntries
|
|
public static method valueOf(p0: java.lang.String): WithAnnotations
|
|
public static method values(): WithAnnotations[]
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public final enum class WithConstructor {
|
|
// source: 'enum.kt'
|
|
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
|
|
private synthetic final static field $VALUES: WithConstructor[]
|
|
public final enum static field A: WithConstructor
|
|
public final enum static field B: WithConstructor
|
|
public final enum static field C: WithConstructor
|
|
private final @org.jetbrains.annotations.NotNull field x: java.lang.String
|
|
private synthetic final static method $entries(): WithConstructor[]
|
|
private synthetic final static method $values(): WithConstructor[]
|
|
static method <clinit>(): void
|
|
private method <init>(p0: java.lang.String, p1: int, p2: java.lang.String): void
|
|
public static @org.jetbrains.annotations.NotNull method getEntries(): kotlin.enums.EnumEntries
|
|
public final @org.jetbrains.annotations.NotNull method getX(): java.lang.String
|
|
public static method valueOf(p0: java.lang.String): WithConstructor
|
|
public static method values(): WithConstructor[]
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
final class WithEntryClass$A {
|
|
// source: 'enum.kt'
|
|
final inner class WithEntryClass$A
|
|
method <init>(p0: java.lang.String, p1: int): void
|
|
public method foo(): void
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public abstract enum class WithEntryClass {
|
|
// source: 'enum.kt'
|
|
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
|
|
private synthetic final static field $VALUES: WithEntryClass[]
|
|
public final enum static field A: WithEntryClass
|
|
final inner class WithEntryClass$A
|
|
private synthetic final static method $entries(): WithEntryClass[]
|
|
private synthetic final static method $values(): WithEntryClass[]
|
|
static method <clinit>(): void
|
|
private method <init>(p0: java.lang.String, p1: int): void
|
|
public synthetic method <init>(p0: java.lang.String, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void
|
|
public abstract method foo(): void
|
|
public static @org.jetbrains.annotations.NotNull method getEntries(): kotlin.enums.EnumEntries
|
|
public static method valueOf(p0: java.lang.String): WithEntryClass
|
|
public static method values(): WithEntryClass[]
|
|
}
|