I wanted a helper like fun <T> decode(json: String): T that works out the target class from T, but T::class gives the error "Cannot use 'T' as reified type parameter". Changing the declaration to inline fun <reified T> makes it compile.
Why is the type not available in a normal generic function, what does reified change, and are there costs or restrictions I should know about before using it widely?




