Join Slack
Powered by
What is an "associated object" in Kotlin, and what...
# codereview
m
Marcello Galhardo
11/16/2022, 12:22 AM
What is an "associated object" in Kotlin, and what is its use cases? I found it by chance, and besides understand how the methods work - I'm not sure what is the use case for it. For reference:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/find-associated-object.html
e
ephemient
11/16/2022, 12:36 AM
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect.full/companion-object.html
and
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-class/object-instance.html
are JVM-only; Kotlin/JS and Kotlin/Native don't have the same runtime reflection capabilities so they need this extra support
m
Marcello Galhardo
11/16/2022, 12:56 AM
Oh, very interesting. Thank you!
58
Views
Open in Slack
Previous
Next