diff options
author | Vsevolod Tolstopyatov <qwwdfsad@gmail.com> | 2020-07-30 04:17:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 14:17:06 +0300 |
commit | d2583db24543ff6ddbc2df258727f14638d4c49a (patch) | |
tree | 08463a9a21c9d6053ad7089e3a97cbcb6aca2fd3 /formats/protobuf | |
parent | caeb0d64c58f7ab50bbd2d38dca8c91134792bb4 (diff) | |
download | kotlinx.serialization-d2583db24543ff6ddbc2df258727f14638d4c49a.tar.gz |
[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
Diffstat (limited to 'formats/protobuf')
-rw-r--r-- | formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/FormatConverterHelpers.kt | 2 |
1 files changed, 1 insertions, 1 deletions
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 <reified T : IMessage> readCompare(it: T, alwaysPrint: Boolean = fals val c = try { val msg = it.toProtobufMessage() val hex = msg.toHex() - obj = protoBuf.decodeFromHexString(hex) + obj = protoBuf.decodeFromHexString<T>(hex) obj == it } catch (e: Exception) { obj = null |