{"action":"closed","issue":{"url":"https://api.github.com/repos/scalameta/scalameta/issues/1669","repository_url":"https://api.github.com/repos/scalameta/scalameta","labels_url":"https://api.github.com/repos/scalameta/scalameta/issues/1669/labels{/name}","comments_url":"https://api.github.com/repos/scalameta/scalameta/issues/1669/comments","events_url":"https://api.github.com/repos/scalameta/scalameta/issues/1669/events","html_url":"https://github.com/scalameta/scalameta/issues/1669","id":338128866,"node_id":"MDU6SXNzdWUzMzgxMjg4NjY=","number":1669,"title":"Soundness hole in metacp","user":{"login":"xeno-by","id":609152,"node_id":"MDQ6VXNlcjYwOTE1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/609152?v=4","gravatar_id":"","url":"https://api.github.com/users/xeno-by","html_url":"https://github.com/xeno-by","followers_url":"https://api.github.com/users/xeno-by/followers","following_url":"https://api.github.com/users/xeno-by/following{/other_user}","gists_url":"https://api.github.com/users/xeno-by/gists{/gist_id}","starred_url":"https://api.github.com/users/xeno-by/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeno-by/subscriptions","organizations_url":"https://api.github.com/users/xeno-by/orgs","repos_url":"https://api.github.com/users/xeno-by/repos","events_url":"https://api.github.com/users/xeno-by/events{/privacy}","received_events_url":"https://api.github.com/users/xeno-by/received_events","type":"User","site_admin":false},"labels":[{"id":832648262,"node_id":"MDU6TGFiZWw4MzI2NDgyNjI=","url":"https://api.github.com/repos/scalameta/scalameta/labels/Scalacp","name":"Scalacp","color":"8237f2","default":false}],"state":"closed","locked":false,"assignee":{"login":"xeno-by","id":609152,"node_id":"MDQ6VXNlcjYwOTE1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/609152?v=4","gravatar_id":"","url":"https://api.github.com/users/xeno-by","html_url":"https://github.com/xeno-by","followers_url":"https://api.github.com/users/xeno-by/followers","following_url":"https://api.github.com/users/xeno-by/following{/other_user}","gists_url":"https://api.github.com/users/xeno-by/gists{/gist_id}","starred_url":"https://api.github.com/users/xeno-by/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeno-by/subscriptions","organizations_url":"https://api.github.com/users/xeno-by/orgs","repos_url":"https://api.github.com/users/xeno-by/repos","events_url":"https://api.github.com/users/xeno-by/events{/privacy}","received_events_url":"https://api.github.com/users/xeno-by/received_events","type":"User","site_admin":false},"assignees":[{"login":"xeno-by","id":609152,"node_id":"MDQ6VXNlcjYwOTE1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/609152?v=4","gravatar_id":"","url":"https://api.github.com/users/xeno-by","html_url":"https://github.com/xeno-by","followers_url":"https://api.github.com/users/xeno-by/followers","following_url":"https://api.github.com/users/xeno-by/following{/other_user}","gists_url":"https://api.github.com/users/xeno-by/gists{/gist_id}","starred_url":"https://api.github.com/users/xeno-by/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeno-by/subscriptions","organizations_url":"https://api.github.com/users/xeno-by/orgs","repos_url":"https://api.github.com/users/xeno-by/repos","events_url":"https://api.github.com/users/xeno-by/events{/privacy}","received_events_url":"https://api.github.com/users/xeno-by/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/scalameta/scalameta/milestones/26","html_url":"https://github.com/scalameta/scalameta/milestone/26","labels_url":"https://api.github.com/repos/scalameta/scalameta/milestones/26/labels","id":3253215,"node_id":"MDk6TWlsZXN0b25lMzI1MzIxNQ==","number":26,"title":"4.0.0-RC1","description":"By 7/16, we're planning to close all the tickets in this milestone (either by fixing or by unassigning the milestone).\r\n\r\nThen, we will impose a code freeze to everything except fixes to regressions from 3.x and will be cutting further RC releases weekly. After a week with no regressions, we will promote the latest RC to final and lift the code freeze.","creator":{"login":"olafurpg","id":1408093,"node_id":"MDQ6VXNlcjE0MDgwOTM=","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},"open_issues":22,"closed_issues":129,"state":"open","created_at":"2018-04-09T16:54:12Z","updated_at":"2018-07-05T12:20:06Z","due_on":"2018-07-16T07:00:00Z","closed_at":null},"comments":4,"created_at":"2018-07-04T04:47:00Z","updated_at":"2018-07-05T12:20:05Z","closed_at":"2018-07-05T12:20:05Z","author_association":"MEMBER","body":"I've been eyeballing the results of metacp, and noticed things like `scala.Int#`, `scala.AnyRef#`, etc all over the place. I'm still getting accustomed to the new package symbol format, so it took a while until I realized that something's wrong. These symbols should've been `scala/Int#`, `scala/AnyRef#`, etc.\r\n\r\nA debugging session revealed the culprit in Scalacp:\r\n\r\n```scala\r\nimplicit class XtensionGSymbolSSymbolInformation(sym: Symbol) {\r\n  ...\r\n  private[meta] def kind: s.SymbolInformation.Kind = {\r\n    sym match {\r\n      ...\r\n      case sym: ExternalSymbol =>\r\n        // NOTE: Object and package external symbols\r\n        // are indistinguishable from each other.\r\n        // This means that metacp never sets k.PACKAGE.\r\n        val hasTermName = {\r\n          val idx = sym.entry.index + 1\r\n          if (sym.entry.scalaSig.hasEntry(idx)) {\r\n            val nameEntryType = sym.entry.scalaSig.table(idx)._1\r\n            nameEntryType == 1\r\n          } else {\r\n            false\r\n          }\r\n        }\r\n        val isModuleClass = sym.entry.entryType == 10\r\n        def isScalaObject: Boolean = isModuleClass && !sym.isJavaDefined\r\n        if (sym.isPackageAccordingToClasspath) k.PACKAGE\r\n        else if (hasTermName || isScalaObject) k.OBJECT\r\n        else k.CLASS\r\n      ...\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nLooks like this logic silently produces incorrect symbols if the user doesn't provide correct dependency classpath to metacp. What's even worse - the resulting incorrect symbols will be cached because Checksum doesn't take dependency classpath into account."}}
{"actor":{"display_login":"olafurpg"}}