[K/N] Intrinsify enumEntries<T>
^KT-59711
This commit is contained in:
committed by
Space Team
parent
26b0b02553
commit
9cbd55aa72
@@ -0,0 +1,15 @@
|
||||
// !LANGUAGE: -EnumEntries
|
||||
// IGNORE_BACKEND: JS
|
||||
// WITH_STDLIB
|
||||
|
||||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
|
||||
import kotlin.enums.*
|
||||
|
||||
enum class E { A, B, C };
|
||||
|
||||
@OptIn(kotlin.ExperimentalStdlibApi::class)
|
||||
fun box() : String {
|
||||
if (enumEntries<E>() != listOf(E.A, E.B, E.C)) return "FAIL"
|
||||
return "OK"
|
||||
}
|
||||
@@ -3,6 +3,11 @@
|
||||
// IGNORE_BACKEND: JS, JVM
|
||||
// WITH_STDLIB
|
||||
|
||||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
|
||||
import kotlin.enums.*
|
||||
|
||||
|
||||
enum class EnumWithClash {
|
||||
values,
|
||||
entries,
|
||||
@@ -14,5 +19,6 @@ fun box(): String {
|
||||
val ref = EnumWithClash::entries
|
||||
if (ref().toString() != "[values, entries, valueOf]") return "FAIL 1"
|
||||
if (EnumWithClash.entries.toString() != "entries") return "FAIL 2"
|
||||
if (enumEntries<EnumWithClash>().toString() != "[values, entries, valueOf]") return "FAIL 3"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user