janvladimirmostert
05/05/2017, 9:51 AMreified
type, automatically make it inline fun
without having to specify inline
.
so currently I have to specify inline
every time I make use of reified
which kinda feels like the abstraction is leaking.
inline fun <reified T : Any> String.fromJson(): T =
Json.decodeValue(this, T::class.java)
becomes
fun <reified T : Any> String.fromJson(): T =
Json.decodeValue(this, T::class.java)
and the compiler automatically makes it inline upon compiling.