Kotlin specification states basic types as "Some types can have a special internal representation - for example, numbers, characters and booleans can be represented as primitive values at runtime". https://kotlinlang.org/docs/basic-types.html
Yet, I am not figuring out any way to know if the Type representation in Kotlin, i.e. instance of KClass is a basic type, or not?
Scope
We need to parse and convert String values to strongly typed instances and for "basic types" we want to use the corresponding to<basic type> auxiliary method, like Java valueOf or boxing.
to*function per each type, then I guess you need to explicitly reference each such type anyway - to choose a specific function. Of course you can use reflection to find the function, but it sounds like an overkill. There are just few such types.to*functions and store them somewhere, e.g. in abasicParsersofMap<KClass, (String) -> Any>. Then, we need to decide whether to go, or not, to thatbasicParsersdepending on the target's type. Off course, we may delegate on the result of finding or not a parser inbasicParsers. But I would prefer to only check that map, if I was really in the presence of a basic type.