From d2583db24543ff6ddbc2df258727f14638d4c49a Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 30 Jul 2020 04:17:06 -0700 Subject: [API stabilization] Serializer lookup enchancements (#948) * Rename getContextualOrDefault to serializer function * Lookup contextual serializer recursively to give consistent experience when contextual type is nested in generic type argument * Provide SerializersModule.serializer(javaType) for the same purpose * Get rid of UnsafeSerializationApi * Lift nullability restrictions from serializer function and all corresponding reified extensions on formats Fixed #802 Fixes #803 --- .../src/kotlinx/serialization/protobuf/FormatConverterHelpers.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'formats/protobuf') diff --git a/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/FormatConverterHelpers.kt b/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/FormatConverterHelpers.kt index 2687fafa..e8e5305a 100644 --- a/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/FormatConverterHelpers.kt +++ b/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/FormatConverterHelpers.kt @@ -65,7 +65,7 @@ inline fun readCompare(it: T, alwaysPrint: Boolean = fals val c = try { val msg = it.toProtobufMessage() val hex = msg.toHex() - obj = protoBuf.decodeFromHexString(hex) + obj = protoBuf.decodeFromHexString(hex) obj == it } catch (e: Exception) { obj = null -- cgit v1.2.3