Why would I use `_enumValues_<Platform>()` o...
# getting-started
v
Why would I use
_enumValues_<Platform>()
over
Platform.values()
?
j
Most likely when it's not a fixed
Platform
enum type, but a reified generic enum type
2
❤️ 1
v
thx
Makes sense
j
values
is not deprecated so now it is
entries
? Is there any
enumEntries<T>
there?
j
I don't think there is an entries-based replacement for
enumValues
yet, but I may be wrong
However, you're right that the second example
Platform.values()
should be replaced by
Platform.entries
in all modern code bases
k
_enumValues_<Platform>()
oh boy didn’t knew about this that’s perfect 😄
v
should be replaced by
Platform.entries
in all modern code bases
Gradle build logic, so no 1.9 yet 🙂
j
I feel you, but Gradle 8.3 is just around the corner with embedded Kotlin 1.9 🙂
Ah wait, the language level will not be updated, my bad
v
Wouldn't change anything, Language version will most likely change earliest in Gradle 9
j
Yep, sorry 😅
v
Besides, that the build I'm trying to change something right now is still on 5.6 😞
🫂 2
😱 3
j
Then I'm glad I carefully used the phrase modern code bases in my previous comment 😄
👌 1
k
m
Kotlin 1.8 considered "not modern", meanwhile some companies are still having a hard time migrating from Java 8 to Java 11 🙃
😄 1