{"action":"reopened","issue":{"url":"https://api.github.com/repos/Swinject/Swinject/issues/28","labels_url":"https://api.github.com/repos/Swinject/Swinject/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/Swinject/Swinject/issues/28/comments","events_url":"https://api.github.com/repos/Swinject/Swinject/issues/28/events","html_url":"https://github.com/Swinject/Swinject/issues/28","id":118890618,"number":28,"title":"Registering multiple (protocol) types for one concrete implementation","user":{"login":"mariob","id":75208,"avatar_url":"https://avatars.githubusercontent.com/u/75208?v=3","gravatar_id":"","url":"https://api.github.com/users/mariob","html_url":"https://github.com/mariob","followers_url":"https://api.github.com/users/mariob/followers","following_url":"https://api.github.com/users/mariob/following{/other_user}","gists_url":"https://api.github.com/users/mariob/gists{/gist_id}","starred_url":"https://api.github.com/users/mariob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariob/subscriptions","organizations_url":"https://api.github.com/users/mariob/orgs","repos_url":"https://api.github.com/users/mariob/repos","events_url":"https://api.github.com/users/mariob/events{/privacy}","received_events_url":"https://api.github.com/users/mariob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-25T17:52:38Z","updated_at":"2015-11-25T18:50:06Z","closed_at":null,"body":"Hi,\r\n\r\nLet's say you have two protocols, __Purchasing__ and __Reserving__. Reserving will reserv a seat and Purchasing will actually purchase a reserved seat:\r\n```\r\nprotocol Reserving {\r\n    func reserv() -> Reservation\r\n}\r\n\r\nprotocol Purchasing {\r\n    func purchase(reservation: Reservation) -> Ticket\r\n}\r\n```\r\nFor some reason (that's another discussion :) it makes sense to conform to both protocols in one concrete class, maybe share some state and make things less complex, legacy code base or what ever. For example:\r\n```\r\nclass TicketService: Reserving, Purchasing {\r\n....\r\n}\r\n```\r\nWe also want/need to register TicketService in the global scope (can only have one instance or things will break :).\r\n\r\nSo to my question... Would it be possible to register multiple protocols for one instance of TicketService, for example:\r\n```\r\ncontainer.register(Purchasing.self, Reserving.self) { r in TicketService() }.inScopeScope(.Global)\r\n```\r\nAre there any language limitations in swift of doing so?"}}