Files
kotlin-fork/plugins/noarg/testData/bytecodeListing/annoOnNotClass.ir.txt
T
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
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>
2023-02-10 16:57:51 +00:00

49 lines
1.6 KiB
Plaintext
Vendored

@NoArg
@kotlin.Metadata
public final enum class Colors {
// source: 'annoOnNotClass.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: Colors[]
public final enum static field RED: Colors
public final enum static field WHITE: Colors
private synthetic final static method $entries(): Colors[]
private synthetic final static method $values(): Colors[]
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): Colors
public static method values(): Colors[]
}
@NoArg
@kotlin.Metadata
public interface Intf {
// source: 'annoOnNotClass.kt'
}
@kotlin.Metadata
public final class MyClass {
// source: 'annoOnNotClass.kt'
private @NoArg @org.jetbrains.annotations.NotNull field abc: java.lang.String
public method <init>(p0: int): void
public final @NoArg @org.jetbrains.annotations.NotNull method getAbc(): java.lang.String
public final @NoArg method setAbc(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
public final @NoArg method someFun(): void
}
@NoArg
@java.lang.annotation.Retention(value=RUNTIME)
@kotlin.Metadata
public annotation class NoArg {
// source: 'annoOnNotClass.kt'
}
@NoArg
@kotlin.Metadata
public final class Obj {
// source: 'annoOnNotClass.kt'
public final static @org.jetbrains.annotations.NotNull field INSTANCE: Obj
static method <clinit>(): void
private method <init>(): void
}