You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method IDeserializer.Deserialize<T>() returns just T, but is capable of returning null. So the signature should be:
T?Deserialize<T>(stringinput);
Without this change, users must invoke this method with a nullable type, like myDeserializer.Deserialize<MyObject?>(theData), which is weird because the fact that this method can return null is part of its contract and an implementation detail, so I shouldn't have to specify a nullable type in the generic parameter.
The text was updated successfully, but these errors were encountered:
Changing the method return type would introduce a potentially breaking change. At the very least it would most likely introduce a number of compiler warnings for a lot of people. I have been toying with the idea of creating a new entry point in to the platform in the next major release and deprecating the current builders (not remove, just mark them as obsolete). Partly to make the method signatures for both the serializer and deserializer more consistent, but also to make the serializer/deserializer namespace only have a couple of types in it, namely the builders and the actual deserializer/serializer interfaces.
I'm going to close this for now and re-look at it when/if that happens. But we're not going to introduce this kind of change in the current versions.
The method
IDeserializer.Deserialize<T>()
returns justT
, but is capable of returning null. So the signature should be:Without this change, users must invoke this method with a nullable type, like
myDeserializer.Deserialize<MyObject?>(theData)
, which is weird because the fact that this method can return null is part of its contract and an implementation detail, so I shouldn't have to specify a nullable type in the generic parameter.The text was updated successfully, but these errors were encountered: