ToNullable() existed for structs already. Now it has also been added for classes. Classes and structs are therefore more alike with this change. ToNullable() for classes should also cover most use cases where UnwrapOrDefault() was used. A new extension class was required to work around overload issues.
If UnwrapOrDefault() was actually used to get the default value of a struct (which I don't think was done very often). We will now need to do: UnwrapOr(default);
That doesn't seem like a bad alternative at all. So I don't think we are loosing anything by removing it.
UnwrapOrDefault()
has been removed.ToNullable()
existed for structs already. Now it has also been added for classes. Classes and structs are therefore more alike with this change.ToNullable()
for classes should also cover most use cases whereUnwrapOrDefault()
was used. A new extension class was required to work around overload issues.If
UnwrapOrDefault()
was actually used to get the default value of a struct (which I don't think was done very often). We will now need to do:UnwrapOr(default);
That doesn't seem like a bad alternative at all. So I don't think we are loosing anything by removing it.