Using KotlinPoet, in order to generate a PropertySpec for adding properties to classes and constructors, you need a TypeName object.
The TypeMirror.asTypeName() KotlinPoet function is deprecated, because it won't always work correctly for Kotlin types.
But I can't find a single example of how to get a correct TypeName for a Kotlin class (e.g. kotlin.String) using the kotlinpoet-metadata APIs, the way the deprecation message says.
The docs for kotlinpoet-metadata APIs also seem completely broken (go to https://square.github.io/kotlinpoet/interop-kotlinx-metadata/#interop-with-kotlinx-metadata and click anything under the APIs section)
Does anyone have an example of how to replace TypeMirror.asTypeName() with some kotlinpoet-metadata code to get a TypeName, so that I can create a PropertySpec?