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-55 non-@objc protocol existentials do not conform to their own protocol type
Issue Description:
When passing a protocol as an argument, it may be useful to know whether it has reference semantics, but there does not appear to be a way to do this in Swift. The following code does not compile but should:
protocolFoo: class {
}
funcuse<P: AnyObject>(type: P.Type) {
}
// Does not compileuse(type: Foo.self)
The text was updated successfully, but these errors were encountered:
In this particular case, it's an even more unfortunate limitation, because reference semantics are different from non-reference semantics, and it still would be nice to know at compile time which one we're dealing with in the case where we don't have an instance.
Environment
Xcode 10, Swift 4
Additional Detail from JIRA
md5: b292e01db2f57940a4b5106a8aed05b9
duplicates:
Issue Description:
When passing a protocol as an argument, it may be useful to know whether it has reference semantics, but there does not appear to be a way to do this in Swift. The following code does not compile but should:
The text was updated successfully, but these errors were encountered: