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
When an `Optional<Any>` is saved in an `Any` variable, trying to cast the the object to a protocol fails, even if the actual object is a class that conforms to that protocol.
protocolModel {}
classModelImpl: Model {}
lettest: Any = ModelImpl() asAny? // I received from a library my object as Any but wrapped in an Optional<Any> letcast = testas? Model// this returns nil letcast2 = testas? ModelImpl// this returns an actual object
Not sure if this is a bug or an expected behaviour, but it's a bit confusing.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 717afe7ddeedc959012564e404e0facf
Issue Description:
When an `Optional<Any>` is saved in an `Any` variable, trying to cast the the object to a protocol fails, even if the actual object is a class that conforms to that protocol.
Not sure if this is a bug or an expected behaviour, but it's a bit confusing.
The text was updated successfully, but these errors were encountered: