File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
core/commonMain/src/kotlinx/serialization Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -283,13 +283,8 @@ private fun <T : Any> KSerializer<T>.nullable(shouldBeNullable: Boolean): KSeria
283
283
*/
284
284
@Suppress(" unused" )
285
285
@PublishedApi
286
- internal fun noCompiledSerializer (forClass : String ): KSerializer <* > {
287
- throw SerializationException (
288
- " Cannot find serializer for class $forClass .\n " +
289
- " Make sure that this class marked with @Serializable annotation," +
290
- " or provide serializer explicitly, or use proper SerializersModule"
291
- )
292
- }
286
+ internal fun noCompiledSerializer (forClass : String ): KSerializer <* > =
287
+ throw SerializationException (notRegisteredMessage(forClass))
293
288
294
289
// Used when compiler intrinsic is inserted
295
290
@OptIn(ExperimentalSerializationApi ::class )
Original file line number Diff line number Diff line change @@ -92,8 +92,10 @@ internal fun KClass<*>.serializerNotRegistered(): Nothing {
92
92
throw SerializationException (notRegisteredMessage())
93
93
}
94
94
95
- internal fun KClass <* >.notRegisteredMessage (): String = " Serializer for class '${simpleName} ' is not found.\n " +
96
- " Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied."
95
+ internal fun KClass <* >.notRegisteredMessage (): String = notRegisteredMessage(simpleName ? : " <local class name not available>" )
96
+
97
+ internal fun notRegisteredMessage (className : String ): String = " Serializer for class '$className ' is not found.\n " +
98
+ " Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.\n "
97
99
98
100
internal expect fun KClass <* >.platformSpecificSerializerNotRegistered (): Nothing
99
101
You can’t perform that action at this time.
0 commit comments