Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlininline functionsSingle-choice MCQ

Why does Kotlin require the type parameter to be marked `reified` in this function, and what does it enable?

inline fun <reified T> List<*>.firstOfType(): T? { for (item in this) if (item is T) return item return null }