tezvyn:

What is a reified type parameter in Kotlin?

Source: kotlinlang.orgadvanced

Tests JVM type erasure and inline function mechanics. Strong answer: reified preserves generic types at runtime via inline expansion, enabling is T checks without Class<T> passing. Red flag: claiming reified works without inline or outside functions.

Tests deep knowledge of JVM type erasure and how Kotlin uses inline functions to recover concrete generic types at call sites. A strong answer covers: type erasure strips T at runtime; inline copies bytecode so the compiler substitutes the actual type; reified enables is T and T::class without reflection hacks. Red flag: saying reified is just syntax sugar for Class<T> or that it works on normal functions.

Read the original → kotlinlang.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

What is a reified type parameter in Kotlin? · Tezvyn