{"action":"opened","issue":{"url":"https://api.github.com/repos/scalameta/scalameta/issues/1358","repository_url":"https://api.github.com/repos/scalameta/scalameta","labels_url":"https://api.github.com/repos/scalameta/scalameta/issues/1358/labels{/name}","comments_url":"https://api.github.com/repos/scalameta/scalameta/issues/1358/comments","events_url":"https://api.github.com/repos/scalameta/scalameta/issues/1358/events","html_url":"https://github.com/scalameta/scalameta/issues/1358","id":299451583,"number":1358,"title":"Simplify method symbol descriptor disambiguation","user":{"login":"olafurpg","id":1408093,"avatar_url":"https://avatars0.githubusercontent.com/u/1408093?v=4","gravatar_id":"","url":"https://api.github.com/users/olafurpg","html_url":"https://github.com/olafurpg","followers_url":"https://api.github.com/users/olafurpg/followers","following_url":"https://api.github.com/users/olafurpg/following{/other_user}","gists_url":"https://api.github.com/users/olafurpg/gists{/gist_id}","starred_url":"https://api.github.com/users/olafurpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olafurpg/subscriptions","organizations_url":"https://api.github.com/users/olafurpg/orgs","repos_url":"https://api.github.com/users/olafurpg/repos","events_url":"https://api.github.com/users/olafurpg/events{/privacy}","received_events_url":"https://api.github.com/users/olafurpg/received_events","type":"User","site_admin":false},"labels":[{"id":528224234,"url":"https://api.github.com/repos/scalameta/scalameta/labels/Semantic","name":"Semantic","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-22T18:01:38Z","updated_at":"2018-02-22T18:01:38Z","closed_at":null,"author_association":"OWNER","body":"Currently, conflicting method descriptors are handled this way\r\n\r\n```scala\r\ndef foo(a: x.A) // foo(A+1)\r\ndef foo(a: y.A) // foo(A+2)\r\n```\r\n\r\nI propose we simplify it to\r\n\r\n```scala\r\ndef foo(a: x.A) // foo(A)\r\ndef foo(a: y.A) // foo(A+1)\r\n```\r\n\r\nThe benefit is to make it easier to compute method symbols, a simple loop like this should be enough\r\n\r\n```scala\r\n\r\nval descriptors = mutable.Map[String, Int]\r\nnode.methods.foreach { method =>\r\n  val descriptor = method.descriptor\r\n  val suffix = descriptors.getOrElseUpdate(descriptor, 0)\r\n  descriptors(descriptor) = suffix + 1\r\n...\r\n\r\n```\r\n\r\nThe current scheme is harder to support because the suffix requires knowing all possibly conflicting method symbols beforehand.\r\n"}}
{"actor":{"display_login":"olafurpg"}}