https://kotlinlang.org logo
j

janvladimirmostert

05/05/2017, 9:51 AM
Suggestion: whenever using a
reified
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.
Copy code
inline fun <reified T : Any> String.fromJson(): T =
	Json.decodeValue(this, T::class.java)
becomes
Copy code
fun <reified T : Any> String.fromJson(): T =
	Json.decodeValue(this, T::class.java)
and the compiler automatically makes it inline upon compiling.
6