KT-53154 extract implementation of enumEntries into an expect/actual internal helper function

It's required, so it can be implemented in different backends
at a different pace and in a different manner
This commit is contained in:
Ilya Gorbunov
2023-07-14 05:29:02 +02:00
committed by Space Team
parent 40a6c81d97
commit 61175889b9
6 changed files with 88 additions and 11 deletions
@@ -0,0 +1,17 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
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>())
}