[K/JS, K/Wasm] Implement enumEntries top-level function ^KT-59712 Fixed
This commit is contained in:
@@ -9,6 +9,10 @@ package kotlin.enums
|
||||
@SinceKotlin("1.8")
|
||||
public sealed interface EnumEntries<E : Enum<E>>
|
||||
|
||||
@PublishedApi
|
||||
@ExperimentalStdlibApi
|
||||
internal external fun <T: Enum<T>> enumEntriesIntrinsic(): EnumEntries<T>
|
||||
|
||||
@PublishedApi
|
||||
@ExperimentalStdlibApi
|
||||
@SinceKotlin("1.8")
|
||||
|
||||
@@ -8,10 +8,6 @@ package kotlin.enums
|
||||
@SinceKotlin("1.9")
|
||||
@ExperimentalStdlibApi
|
||||
@PublishedApi
|
||||
internal actual inline fun <reified T : Enum<T>> enumEntriesIntrinsic(): EnumEntries<T> {
|
||||
/*
|
||||
* Implementation note: this body will be replaced with `throw NotImplementedException()` the moment
|
||||
* all backends starts intrinsifying this call.
|
||||
*/
|
||||
return enumEntries(enumValues<T>())
|
||||
}
|
||||
// TODO: After the expect fun enumEntriesIntrinsic become non-inline function, the suppress and external keyword should be removed
|
||||
@Suppress("INLINE_EXTERNAL_DECLARATION", "WRONG_JS_INTEROP_TYPE")
|
||||
internal actual external inline fun <reified T : Enum<T>> enumEntriesIntrinsic(): EnumEntries<T>
|
||||
Reference in New Issue
Block a user