
Lightweight reflection API facilitates compile-time and run-time type token generation, supporting generic parameter handling and type comparison without incurring run-time reflection overhead.
A light multiplatform Kotlin reflection API.
erased generates a TypeToken that represents a type without its (optional) generic parameters, constructed at compile-time (no run-time reflection overhead).generic generates a TypeToken that represents a type with its generic parameters, constructed at compile-time (with reflection).erasedComp generates a TypeToken that represents a type with its generic parameters, constructed at run-time (with explicit parameters: no run-time overhead but verbose syntax).All TypeTokens are comparable between them:
erased<String>() == generic<String>()
erased<List<*>>() == generic<List<*>>()
generic<List<String>>() == erasedComp<List<String>>(List::class, String::class)A light multiplatform Kotlin reflection API.
erased generates a TypeToken that represents a type without its (optional) generic parameters, constructed at compile-time (no run-time reflection overhead).generic generates a TypeToken that represents a type with its generic parameters, constructed at compile-time (with reflection).erasedComp generates a TypeToken that represents a type with its generic parameters, constructed at run-time (with explicit parameters: no run-time overhead but verbose syntax).All TypeTokens are comparable between them:
erased<String>() == generic<String>()
erased<List<*>>() == generic<List<*>>()
generic<List<String>>() == erasedComp<List<String>>(List::class, String::class)