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
But if the protocol is marked as @objc, it generates the warning "Method cannot be a member of an @objc protocol because its result type cannot be represented in Objective-C"
However, adding Self as a return type to a protocol method doesn't usually treat Self as an associatedType requirement, so it's not clear why a protocol method returning Self can't be represented in Objective-C.
The equivalent Objective-C code is permitted and works as you'd expect:
Additional Detail from JIRA
md5: d02438d6b1525db5cf95f2cfc2d82dd3
Issue Description:
In Swift, the following is permitted:
But if the protocol is marked as @objc, it generates the warning "Method cannot be a member of an @objc protocol because its result type cannot be represented in Objective-C"
However, adding Self as a return type to a protocol method doesn't usually treat Self as an associatedType requirement, so it's not clear why a protocol method returning Self can't be represented in Objective-C.
The equivalent Objective-C code is permitted and works as you'd expect:
The text was updated successfully, but these errors were encountered: