{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/4125","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4125/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4125/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4125/events","html_url":"https://github.com/realm/realm-cocoa/issues/4125","id":178571895,"number":4125,"title":"RealmSwift.Error conflicts with Swift standard library Error","user":{"login":"katunch","id":1769636,"avatar_url":"https://avatars.githubusercontent.com/u/1769636?v=3","gravatar_id":"","url":"https://api.github.com/users/katunch","html_url":"https://github.com/katunch","followers_url":"https://api.github.com/users/katunch/followers","following_url":"https://api.github.com/users/katunch/following{/other_user}","gists_url":"https://api.github.com/users/katunch/gists{/gist_id}","starred_url":"https://api.github.com/users/katunch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katunch/subscriptions","organizations_url":"https://api.github.com/users/katunch/orgs","repos_url":"https://api.github.com/users/katunch/repos","events_url":"https://api.github.com/users/katunch/events{/privacy}","received_events_url":"https://api.github.com/users/katunch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-22T10:20:32Z","updated_at":"2016-09-22T11:35:02Z","closed_at":null,"body":"## Goals\r\nMake RealmSwift working with other libraries\r\n\r\n## Expected Results\r\nRealmSwift should inherit from Swifts standard library Error instead of redeclare.\r\n\r\n## Actual Results\r\nFor example: If you have a view controller which imports `RealmSwift` and `MessageUI` which is implementing a `MFMailComposeViewControllerDelegate` the project is no longer able to build. The error is:\r\n```\r\n 'Error' is ambiguous for type lookup in this context\r\n```\r\n\r\n## Steps to Reproduce\r\nJust create a view controller which implements `MFMailComposeViewControllerDelegate` or as an other example `UIWebViewDelegate`. The project will build. As soon as you do a `import RealmSwift` the project will no longer build.\r\n\r\n## Code Sample\r\nHere a sample of working code: \r\n```swift\r\nimport UIKit\r\nimport MessageUI\r\n//import RealmSwift\r\n\r\nclass ViewController: UIViewController {\r\n\r\n    override func viewDidLoad() {\r\n        super.viewDidLoad()\r\n        // Do any additional setup after loading the view, typically from a nib.\r\n    }\r\n\r\n    override func didReceiveMemoryWarning() {\r\n        super.didReceiveMemoryWarning()\r\n        // Dispose of any resources that can be recreated.\r\n    }\r\n\r\n\r\n}\r\n\r\nextension ViewController: MFMailComposeViewControllerDelegate {\r\n    func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {\r\n        // do something\r\n    }\r\n}\r\n\r\nextension ViewController: UIWebViewDelegate {\r\n    func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {\r\n        \r\n    }\r\n}\r\n```\r\n\r\nand as soon as you import RealmSwift it will break.\r\n\r\n```swift\r\nimport UIKit\r\nimport MessageUI\r\nimport RealmSwift\r\n\r\nclass ViewController: UIViewController {\r\n\r\n    override func viewDidLoad() {\r\n        super.viewDidLoad()\r\n        // Do any additional setup after loading the view, typically from a nib.\r\n    }\r\n\r\n    override func didReceiveMemoryWarning() {\r\n        super.didReceiveMemoryWarning()\r\n        // Dispose of any resources that can be recreated.\r\n    }\r\n\r\n\r\n}\r\n\r\nextension ViewController: MFMailComposeViewControllerDelegate {\r\n    func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {\r\n        // do something\r\n    }\r\n}\r\n\r\nextension ViewController: UIWebViewDelegate {\r\n    func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {\r\n        \r\n    }\r\n}\r\n```\r\n![viewcontroller_swift](https://cloud.githubusercontent.com/assets/1769636/18744573/e221328e-80be-11e6-8512-1bee9c6de9b0.jpg)\r\n\r\n\r\n## Version of Realm and Tooling\r\n\r\nRealm version:\r\n```\r\nRealm (1.1.0)\r\nRealmSwift (1.1.0)\r\n```\r\n\r\nXcode version: \r\n```\r\nXcode 8.0\r\nBuild version 8A218a\r\n```\r\n\r\niOS/OSX version: \r\n```\r\nProductName:\tMac OS X\r\nProductVersion:\t10.11.6\r\nBuildVersion:\t15G1004\r\n\r\nBuildtarget iOS: 9.x and newer\r\n```\r\n\r\nDependency manager + version:\r\n```\r\ncocoapods 1.1.0.beta.1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/248878441","html_url":"https://github.com/realm/realm-cocoa/issues/4125#issuecomment-248878441","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4125","id":248878441,"user":{"login":"max-potapov","id":1907011,"avatar_url":"https://avatars.githubusercontent.com/u/1907011?v=3","gravatar_id":"","url":"https://api.github.com/users/max-potapov","html_url":"https://github.com/max-potapov","followers_url":"https://api.github.com/users/max-potapov/followers","following_url":"https://api.github.com/users/max-potapov/following{/other_user}","gists_url":"https://api.github.com/users/max-potapov/gists{/gist_id}","starred_url":"https://api.github.com/users/max-potapov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-potapov/subscriptions","organizations_url":"https://api.github.com/users/max-potapov/orgs","repos_url":"https://api.github.com/users/max-potapov/repos","events_url":"https://api.github.com/users/max-potapov/events{/privacy}","received_events_url":"https://api.github.com/users/max-potapov/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T11:35:02Z","updated_at":"2016-09-22T11:35:02Z","body":"Adding `RealmSwift` import will make existing code broken. Temporary workaround is replacing `Error` to `Swift.Error` for whole project. Not Swifty!"}}
{"actor":{"display_login":"max-potapov"}}