mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Make enum entries initialize before companion object. This helps in situation when companion object initializer refers to enum fields. JVM be generates <clinit> method which first initializes all enum fields and then runs companion object initializer. This commit introduces the similar behaviour in JS BE. The old behaviour was: initialize companion object in constructor. In enum, constructor is called to initialize enum fields, so previously companion object was initialized first, which is incorrect. See KT-16745
43 lines
1.6 KiB
Plaintext
Vendored
43 lines
1.6 KiB
Plaintext
Vendored
@kotlin.Metadata
|
|
public enum class E {
|
|
public final static field Companion: E.Companion
|
|
public final static field X: E
|
|
public final static field Y: E
|
|
inner class E/Companion
|
|
protected method <init>(@java.lang.Synthetic p0: java.lang.String, @java.lang.Synthetic p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): void
|
|
public static method valueOf(p0: java.lang.String): E
|
|
public static method values(): E[]
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public final static class E/Companion {
|
|
inner class E/Companion
|
|
private method <init>(): void
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public final class EnumCompanionInitKt {
|
|
private static @org.jetbrains.annotations.NotNull field result: java.lang.String
|
|
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
|
public final static @org.jetbrains.annotations.NotNull method getResult(): java.lang.String
|
|
public final static method setResult(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public enum class F {
|
|
public final static field Companion: F.Companion
|
|
public final static field X: F
|
|
public final static field Y: F
|
|
inner class F/Companion
|
|
protected method <init>(@java.lang.Synthetic p0: java.lang.String, @java.lang.Synthetic p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): void
|
|
public static method valueOf(p0: java.lang.String): F
|
|
public static method values(): F[]
|
|
}
|
|
|
|
@kotlin.Metadata
|
|
public final static class F/Companion {
|
|
inner class F/Companion
|
|
private method <init>(): void
|
|
public final method foo(): void
|
|
}
|