fix of kspCommonMainKotlinMetadata call

This commit is contained in:
2025-07-11 16:39:08 +06:00
parent 57f009e8aa
commit fa45e7b696
2 changed files with 4 additions and 3 deletions

View File

@@ -6,9 +6,10 @@ import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.asTypeName
import kotlin.reflect.KClass
@Suppress("NOTHING_TO_INLINE")
@OptIn(KspExperimental::class)
fun KClass<*>.safeClassName() = runCatching {
asTypeName()
inline fun safeClassName(classnameGetter: () -> KClass<*>) = runCatching {
classnameGetter().asTypeName()
}.getOrElse { e ->
if (e is KSTypeNotPresentException) {
ClassName(