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
Allows for the refresh extension function to be callable for MutableEmail given that it is an indirect subclass of CommonDataEntity. However, the refresh function itself only returns immutable instances. So,
var email:MutableEmail?
email = email?.refresh(contactsApi) // returns an instance of `Email`, which cannot be casted to a `MutableEmail`.
The text was updated successfully, but these errors were encountered:
Using the
DataRefresh
extension function on a direct subclass ofCommonDataEntity
works just fine. For example, to refresh an immutable email,An exception?!
However, when trying to refresh a mutable email,
Will throw an exception,
Why?
The reason this occurs is because of the function signature,
Combined with the following class hierarchy,
Allows for the
refresh
extension function to be callable forMutableEmail
given that it is an indirect subclass ofCommonDataEntity
. However, therefresh
function itself only returns immutable instances. So,The text was updated successfully, but these errors were encountered: