{"action":"created","issue":{"url":"https://api.github.com/repos/scala/collection-strawman/issues/375","repository_url":"https://api.github.com/repos/scala/collection-strawman","labels_url":"https://api.github.com/repos/scala/collection-strawman/issues/375/labels{/name}","comments_url":"https://api.github.com/repos/scala/collection-strawman/issues/375/comments","events_url":"https://api.github.com/repos/scala/collection-strawman/issues/375/events","html_url":"https://github.com/scala/collection-strawman/issues/375","id":292104539,"number":375,"title":"Consider adding a deprecated `+` on collection.Set/Map","user":{"login":"lrytz","id":119636,"avatar_url":"https://avatars1.githubusercontent.com/u/119636?v=4","gravatar_id":"","url":"https://api.github.com/users/lrytz","html_url":"https://github.com/lrytz","followers_url":"https://api.github.com/users/lrytz/followers","following_url":"https://api.github.com/users/lrytz/following{/other_user}","gists_url":"https://api.github.com/users/lrytz/gists{/gist_id}","starred_url":"https://api.github.com/users/lrytz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrytz/subscriptions","organizations_url":"https://api.github.com/users/lrytz/orgs","repos_url":"https://api.github.com/users/lrytz/repos","events_url":"https://api.github.com/users/lrytz/events{/privacy}","received_events_url":"https://api.github.com/users/lrytz/received_events","type":"User","site_admin":false},"labels":[{"id":785710062,"url":"https://api.github.com/repos/scala/collection-strawman/labels/blocker","name":"blocker","color":"e0561f","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-01-27T08:33:15Z","updated_at":"2018-02-09T11:42:46Z","closed_at":null,"author_association":"OWNER","body":"The fact that `collection.Set` and `mutable.Set` no longer have a `+` method can lead to very error confusing messages or even confusing compiling code. I think this could cause quite some headaches for users during the migration.\r\n\r\n```\r\nscala> Set(1) + 2\r\n                ^\r\n       error: type mismatch;\r\n        found   : Int(2)\r\n        required: String\r\n```\r\n\r\nUser: It's clearly a set of `Int`s, why does it want a `String`?\r\n\r\n```\r\nscala> Set(\"a\") + \"b\"\r\nres14: String = HashSet(a)b\r\n```\r\n\r\nUser: Going to file a bug, there's something wrong with `HashSet.toString`.\r\n\r\nSame for Map (`Map(1 -> \"a\") + (2 -> \"b\")`).\r\n\r\nOne could argue we have similar issues with 2.12 collections, for example\r\n```\r\nscala> List(1) + 2\r\n<console>:15: error: type mismatch;\r\n found   : Int(2)\r\n required: String\r\n       List(1) + 2\r\n                 ^\r\n\r\nscala> List(\"a\") + \"b\"\r\nres10: String = List(a)b\r\n```\r\n\r\nBut the difference is, IMO, that `+` is a common operation on (immutable) Sets and Maps, but not on other types. So it will happen more often that someone will try to call `+` on a `collection.Set/Map`."},"comment":{"url":"https://api.github.com/repos/scala/collection-strawman/issues/comments/364411932","html_url":"https://github.com/scala/collection-strawman/issues/375#issuecomment-364411932","issue_url":"https://api.github.com/repos/scala/collection-strawman/issues/375","id":364411932,"user":{"login":"lrytz","id":119636,"avatar_url":"https://avatars1.githubusercontent.com/u/119636?v=4","gravatar_id":"","url":"https://api.github.com/users/lrytz","html_url":"https://github.com/lrytz","followers_url":"https://api.github.com/users/lrytz/followers","following_url":"https://api.github.com/users/lrytz/following{/other_user}","gists_url":"https://api.github.com/users/lrytz/gists{/gist_id}","starred_url":"https://api.github.com/users/lrytz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrytz/subscriptions","organizations_url":"https://api.github.com/users/lrytz/orgs","repos_url":"https://api.github.com/users/lrytz/repos","events_url":"https://api.github.com/users/lrytz/events{/privacy}","received_events_url":"https://api.github.com/users/lrytz/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T11:42:46Z","updated_at":"2018-02-09T11:42:46Z","author_association":"OWNER","body":"Even if we didn't have `any2stringadd`, I'd be for adding `+` to improve compatibility.\r\n\r\nWe should also discourage the use of `collection.X` factories. Or is there a good reason to ever use `collection.Set(\"hi\")` over `collection.immutable.Set(\"hi\")`?"}}
{"actor":{"display_login":"lrytz"}}