mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-15 05:19:23 +00:00
fix of kspCommonMainKotlinMetadata call
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user