We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c78e950 commit 83003e0Copy full SHA for 83003e0
core/commonMain/src/kotlinx/serialization/internal/Platform.common.kt
@@ -99,6 +99,11 @@ internal expect fun KClass<*>.platformSpecificSerializerNotRegistered(): Nothing
99
@Suppress("UNCHECKED_CAST")
100
internal fun KType.kclass() = when (val t = classifier) {
101
is KClass<*> -> t
102
+ is KTypeParameter -> {
103
+ error("Captured type paramerer $t from generic non-reified function. " +
104
+ "Such functionality cannot be supported as $t is erased, either specify serializer explicitly or make " +
105
+ "calling function inline with reified $t")
106
+ }
107
else -> error("Only KClass supported as classifier, got $t")
108
} as KClass<Any>
109
0 commit comments