{"action":"opened","issue":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/991","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/991/labels{/name}","comments_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/991/comments","events_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/991/events","html_url":"https://github.com/lionheart/openradar-mirror/issues/991","id":98696002,"number":991,"title":"21343400: Swift: unable to express type that inherits from a superclass and conforms to a protocol","user":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/reproducible:always","name":"reproducible:always","color":"5319e7"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/status:open","name":"status:open","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/8","html_url":"https://github.com/lionheart/openradar-mirror/milestones/Swift","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/8/labels","id":1237422,"number":8,"title":"Swift","description":null,"creator":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2015-08-03T02:08:34Z","updated_at":"2015-08-03T08:25:49Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-03T08:25:49Z","updated_at":"2015-08-03T08:25:49Z","closed_at":null,"body":"#### Description\n\nAssume we have the following example protocol in Swift:\r\n\r\nprotocol MyProtocol {\r\n    func protocolMethod() -> Void\r\n}\r\n\r\nNow, imagine that you want to declare a variable that is of some specific class type (e.g. NSEnumerator), something like:\r\n\r\nvar foo: NSEnumerator\r\n\r\nbut in addition to this, you also want to specify that the type of foo must additionally conform to the protocol MyProtocol. (In other words, foo is both an NSEnumerator and also conforms to MyProtocol.)\r\n\r\nThere is no way to express this in Swift, and this is problematic. Here are some attempts at doing this, which do not work:\r\n\r\nvar foo: NSEnumerator, MyProtocol // does not compile\r\nvar foo: NSEnumerator<MyProtocol> // does not compile\r\nvar foo: protocol<NSEnumerator, MyProtocol> // does not compile\r\n\r\nNote that this is possible to do in Objective-C, and is fairly common:\r\n\r\nNSEnumerator<MyProtocol> *foo;\r\n\r\nSteps to Reproduce:\r\nN/A\r\n\r\nExpected Results:\r\nN/A\r\n\r\nActual Results:\r\nN/A\r\n\r\nVersion:\r\nSwift 2.0\r\n\r\nNotes:\r\nThis Stack Overflow post has some related discussion, but if you look at the comments on this answer it's clear that there isn't a way to declare this in Swift:\r\nhttp://stackoverflow.com/a/24027473/796419\r\n\r\nConfiguration:\r\nXcode 7 beta 1\n\n-\nProduct Version: Swift 2.0\nCreated: 2015-06-11T18:51:19.430180\nOriginated: 2015-06-11T00:00:00\nOpen Radar Link: http://www.openradar.me/21343400"}}