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
SR-3871 Protocol passing via objective-c / Any can't be cast back to protocol type
Issue Description:
A Swift struct assigned to an Objective-C id property (Any?) cannot be cast or compared to a Swift protocol type, and must first be cast back to its original type.
protocolAProtocol{vartitle:String{get}}structAStruct:AProtocol{vartitle:String=""}letvalue:Any?=AStruct()
value is AProtocol// == trueletdragItem=UIDragItem(itemProvider:NSItemProvider())
dragItem.localObject =AStruct()//localObject is of type Any?
dragItem.localObject is AProtocol// == false
dragItem.localObject as?AProtocol// == nil
dragItem.localObject as?AStruct is AProtocol// == true
dragItem.localObject as?AStructas?AProtocol// != nil
The text was updated successfully, but these errors were encountered:
Environment
Xcode 9.0 beta 3, Swift 4.0
Additional Detail from JIRA
md5: 1ce388562651e8fee22b7ccf96a946a0
duplicates:
Issue Description:
A Swift struct assigned to an Objective-C id property (Any?) cannot be cast or compared to a Swift protocol type, and must first be cast back to its original type.
The text was updated successfully, but these errors were encountered: