{"action":"opened","number":4671,"pull_request":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/4671","id":195167449,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MTY3NDQ5","html_url":"https://github.com/lampepfl/dotty/pull/4671","diff_url":"https://github.com/lampepfl/dotty/pull/4671.diff","patch_url":"https://github.com/lampepfl/dotty/pull/4671.patch","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/4671","number":4671,"state":"open","locked":false,"title":"Add TypeOf (first step towards transparent methods)","user":{"login":"gsps","id":2364189,"node_id":"MDQ6VXNlcjIzNjQxODk=","avatar_url":"https://avatars1.githubusercontent.com/u/2364189?v=4","gravatar_id":"","url":"https://api.github.com/users/gsps","html_url":"https://github.com/gsps","followers_url":"https://api.github.com/users/gsps/followers","following_url":"https://api.github.com/users/gsps/following{/other_user}","gists_url":"https://api.github.com/users/gsps/gists{/gist_id}","starred_url":"https://api.github.com/users/gsps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsps/subscriptions","organizations_url":"https://api.github.com/users/gsps/orgs","repos_url":"https://api.github.com/users/gsps/repos","events_url":"https://api.github.com/users/gsps/events{/privacy}","received_events_url":"https://api.github.com/users/gsps/received_events","type":"User","site_admin":false},"body":"We ended up working around several limitations of the `AnnotatedType` infrastructure:\r\n\r\n* First and foremost, we discovered that a custom kind of equality is required to (type-) compare `TypeOf`s: After typing some trees may have been transformed, e.g. certain `Ident`s into `TypeTree`s, which in turn breaks the \"naive\" tree equality employed by AnnotatedType. Instead, we defined equality of `TypeOf` based on the top-level tree node: E.g., two `TypeOf`s with `if` as their top-level tree are equal if the types of their `cond`s, `thenb`s and `elseb`s are.\r\n\r\n* Similarly, we discovered that special handling is required for `TypeOf` in `TypeMap`s. One crucial aspect is that `AnnotatedType` would map over the underlying type and the tree separately, potentially causing the two to go out of sync. As an example, consider the following:\r\n\r\n```\r\nLet a: Boolean, b: Int, c: Int\r\n\r\n                     .substBy(c.type, b.type)\r\n\r\n{ if (a) b else c } +-------------------------> { if (a) b else b }\r\n\r\n         +                                               +\r\n         |                                               |\r\n         |  .underlying                                  |  .underlying\r\n         |                                               |\r\n         v           .substBy(c.type, b.type)            v\r\n\r\nb.type | c.type     +------------X------------>  b.type | b.type\r\n= Int | Int                (doesn't hold)        = b.type\r\n= Int\r\n```\r\n\r\nIn other words, we can't rely on the lower path, so we instead propose to always derive the underlying type from the `TypeOf`'s mapped-over tree (the top path).\r\n\r\n* Similarly, without special handling, implementations of `TreeAccumulator` would actually ignore annotations. For instance, the dependency status of `TermLambda`s wouldn't take a `TypeOf`'s tree into account, thus skipping some of the necessary substitutions. This can be fixed, of course, by making TreeAccumulator (or all of its relevant implementations) aware of annotations. Either way, making `AnnotatedType` work out of the box would require some additional investigation.","created_at":"2018-06-15T13:03:31Z","updated_at":"2018-06-15T13:03:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lampepfl/dotty/pulls/4671/commits","review_comments_url":"https://api.github.com/repos/lampepfl/dotty/pulls/4671/comments","review_comment_url":"https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/4671/comments","statuses_url":"https://api.github.com/repos/lampepfl/dotty/statuses/bfbfaddb5ff1a85fa0193322565fef31ac6559a7","head":{"label":"dotty-staging:add-transparent-5","ref":"add-transparent-5","sha":"bfbfaddb5ff1a85fa0193322565fef31ac6559a7","user":{"login":"dotty-staging","id":6998674,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg2NzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6998674?v=4","gravatar_id":"","url":"https://api.github.com/users/dotty-staging","html_url":"https://github.com/dotty-staging","followers_url":"https://api.github.com/users/dotty-staging/followers","following_url":"https://api.github.com/users/dotty-staging/following{/other_user}","gists_url":"https://api.github.com/users/dotty-staging/gists{/gist_id}","starred_url":"https://api.github.com/users/dotty-staging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotty-staging/subscriptions","organizations_url":"https://api.github.com/users/dotty-staging/orgs","repos_url":"https://api.github.com/users/dotty-staging/repos","events_url":"https://api.github.com/users/dotty-staging/events{/privacy}","received_events_url":"https://api.github.com/users/dotty-staging/received_events","type":"Organization","site_admin":false},"repo":{"id":17904384,"node_id":"MDEwOlJlcG9zaXRvcnkxNzkwNDM4NA==","name":"dotty","full_name":"dotty-staging/dotty","owner":{"login":"dotty-staging","id":6998674,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg2NzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6998674?v=4","gravatar_id":"","url":"https://api.github.com/users/dotty-staging","html_url":"https://github.com/dotty-staging","followers_url":"https://api.github.com/users/dotty-staging/followers","following_url":"https://api.github.com/users/dotty-staging/following{/other_user}","gists_url":"https://api.github.com/users/dotty-staging/gists{/gist_id}","starred_url":"https://api.github.com/users/dotty-staging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotty-staging/subscriptions","organizations_url":"https://api.github.com/users/dotty-staging/orgs","repos_url":"https://api.github.com/users/dotty-staging/repos","events_url":"https://api.github.com/users/dotty-staging/events{/privacy}","received_events_url":"https://api.github.com/users/dotty-staging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotty-staging/dotty","description":"Research platform for new language concepts and compiler technologies for Scala.","fork":true,"url":"https://api.github.com/repos/dotty-staging/dotty","forks_url":"https://api.github.com/repos/dotty-staging/dotty/forks","keys_url":"https://api.github.com/repos/dotty-staging/dotty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotty-staging/dotty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotty-staging/dotty/teams","hooks_url":"https://api.github.com/repos/dotty-staging/dotty/hooks","issue_events_url":"https://api.github.com/repos/dotty-staging/dotty/issues/events{/number}","events_url":"https://api.github.com/repos/dotty-staging/dotty/events","assignees_url":"https://api.github.com/repos/dotty-staging/dotty/assignees{/user}","branches_url":"https://api.github.com/repos/dotty-staging/dotty/branches{/branch}","tags_url":"https://api.github.com/repos/dotty-staging/dotty/tags","blobs_url":"https://api.github.com/repos/dotty-staging/dotty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotty-staging/dotty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotty-staging/dotty/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotty-staging/dotty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotty-staging/dotty/statuses/{sha}","languages_url":"https://api.github.com/repos/dotty-staging/dotty/languages","stargazers_url":"https://api.github.com/repos/dotty-staging/dotty/stargazers","contributors_url":"https://api.github.com/repos/dotty-staging/dotty/contributors","subscribers_url":"https://api.github.com/repos/dotty-staging/dotty/subscribers","subscription_url":"https://api.github.com/repos/dotty-staging/dotty/subscription","commits_url":"https://api.github.com/repos/dotty-staging/dotty/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotty-staging/dotty/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotty-staging/dotty/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotty-staging/dotty/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotty-staging/dotty/contents/{+path}","compare_url":"https://api.github.com/repos/dotty-staging/dotty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotty-staging/dotty/merges","archive_url":"https://api.github.com/repos/dotty-staging/dotty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotty-staging/dotty/downloads","issues_url":"https://api.github.com/repos/dotty-staging/dotty/issues{/number}","pulls_url":"https://api.github.com/repos/dotty-staging/dotty/pulls{/number}","milestones_url":"https://api.github.com/repos/dotty-staging/dotty/milestones{/number}","notifications_url":"https://api.github.com/repos/dotty-staging/dotty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotty-staging/dotty/labels{/name}","releases_url":"https://api.github.com/repos/dotty-staging/dotty/releases{/id}","deployments_url":"https://api.github.com/repos/dotty-staging/dotty/deployments","created_at":"2014-03-19T13:06:15Z","updated_at":"2018-06-09T16:07:25Z","pushed_at":"2018-06-15T12:53:25Z","git_url":"git://github.com/dotty-staging/dotty.git","ssh_url":"git@github.com:dotty-staging/dotty.git","clone_url":"https://github.com/dotty-staging/dotty.git","svn_url":"https://github.com/dotty-staging/dotty","homepage":"","size":50525,"stargazers_count":11,"watchers_count":11,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4,"open_issues":0,"watchers":11,"default_branch":"master"}},"base":{"label":"lampepfl:master","ref":"master","sha":"76b110b5bb029a6607f517304dd2fa9c58547a88","user":{"login":"lampepfl","id":2684793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODQ3OTM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684793?v=4","gravatar_id":"","url":"https://api.github.com/users/lampepfl","html_url":"https://github.com/lampepfl","followers_url":"https://api.github.com/users/lampepfl/followers","following_url":"https://api.github.com/users/lampepfl/following{/other_user}","gists_url":"https://api.github.com/users/lampepfl/gists{/gist_id}","starred_url":"https://api.github.com/users/lampepfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampepfl/subscriptions","organizations_url":"https://api.github.com/users/lampepfl/orgs","repos_url":"https://api.github.com/users/lampepfl/repos","events_url":"https://api.github.com/users/lampepfl/events{/privacy}","received_events_url":"https://api.github.com/users/lampepfl/received_events","type":"Organization","site_admin":false},"repo":{"id":7035651,"node_id":"MDEwOlJlcG9zaXRvcnk3MDM1NjUx","name":"dotty","full_name":"lampepfl/dotty","owner":{"login":"lampepfl","id":2684793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODQ3OTM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684793?v=4","gravatar_id":"","url":"https://api.github.com/users/lampepfl","html_url":"https://github.com/lampepfl","followers_url":"https://api.github.com/users/lampepfl/followers","following_url":"https://api.github.com/users/lampepfl/following{/other_user}","gists_url":"https://api.github.com/users/lampepfl/gists{/gist_id}","starred_url":"https://api.github.com/users/lampepfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampepfl/subscriptions","organizations_url":"https://api.github.com/users/lampepfl/orgs","repos_url":"https://api.github.com/users/lampepfl/repos","events_url":"https://api.github.com/users/lampepfl/events{/privacy}","received_events_url":"https://api.github.com/users/lampepfl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lampepfl/dotty","description":"Research compiler that will become Scala 3","fork":false,"url":"https://api.github.com/repos/lampepfl/dotty","forks_url":"https://api.github.com/repos/lampepfl/dotty/forks","keys_url":"https://api.github.com/repos/lampepfl/dotty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lampepfl/dotty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lampepfl/dotty/teams","hooks_url":"https://api.github.com/repos/lampepfl/dotty/hooks","issue_events_url":"https://api.github.com/repos/lampepfl/dotty/issues/events{/number}","events_url":"https://api.github.com/repos/lampepfl/dotty/events","assignees_url":"https://api.github.com/repos/lampepfl/dotty/assignees{/user}","branches_url":"https://api.github.com/repos/lampepfl/dotty/branches{/branch}","tags_url":"https://api.github.com/repos/lampepfl/dotty/tags","blobs_url":"https://api.github.com/repos/lampepfl/dotty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lampepfl/dotty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lampepfl/dotty/git/refs{/sha}","trees_url":"https://api.github.com/repos/lampepfl/dotty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lampepfl/dotty/statuses/{sha}","languages_url":"https://api.github.com/repos/lampepfl/dotty/languages","stargazers_url":"https://api.github.com/repos/lampepfl/dotty/stargazers","contributors_url":"https://api.github.com/repos/lampepfl/dotty/contributors","subscribers_url":"https://api.github.com/repos/lampepfl/dotty/subscribers","subscription_url":"https://api.github.com/repos/lampepfl/dotty/subscription","commits_url":"https://api.github.com/repos/lampepfl/dotty/commits{/sha}","git_commits_url":"https://api.github.com/repos/lampepfl/dotty/git/commits{/sha}","comments_url":"https://api.github.com/repos/lampepfl/dotty/comments{/number}","issue_comment_url":"https://api.github.com/repos/lampepfl/dotty/issues/comments{/number}","contents_url":"https://api.github.com/repos/lampepfl/dotty/contents/{+path}","compare_url":"https://api.github.com/repos/lampepfl/dotty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lampepfl/dotty/merges","archive_url":"https://api.github.com/repos/lampepfl/dotty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lampepfl/dotty/downloads","issues_url":"https://api.github.com/repos/lampepfl/dotty/issues{/number}","pulls_url":"https://api.github.com/repos/lampepfl/dotty/pulls{/number}","milestones_url":"https://api.github.com/repos/lampepfl/dotty/milestones{/number}","notifications_url":"https://api.github.com/repos/lampepfl/dotty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lampepfl/dotty/labels{/name}","releases_url":"https://api.github.com/repos/lampepfl/dotty/releases{/id}","deployments_url":"https://api.github.com/repos/lampepfl/dotty/deployments","created_at":"2012-12-06T12:57:33Z","updated_at":"2018-06-15T10:09:32Z","pushed_at":"2018-06-15T09:35:12Z","git_url":"git://github.com/lampepfl/dotty.git","ssh_url":"git@github.com:lampepfl/dotty.git","clone_url":"https://github.com/lampepfl/dotty.git","svn_url":"https://github.com/lampepfl/dotty","homepage":"http://dotty.epfl.ch","size":404200,"stargazers_count":2728,"watchers_count":2728,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":379,"mirror_url":null,"archived":false,"open_issues_count":402,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":379,"open_issues":402,"watchers":2728,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/4671"},"html":{"href":"https://github.com/lampepfl/dotty/pull/4671"},"issue":{"href":"https://api.github.com/repos/lampepfl/dotty/issues/4671"},"comments":{"href":"https://api.github.com/repos/lampepfl/dotty/issues/4671/comments"},"review_comments":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/4671/comments"},"review_comment":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/4671/commits"},"statuses":{"href":"https://api.github.com/repos/lampepfl/dotty/statuses/bfbfaddb5ff1a85fa0193322565fef31ac6559a7"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":34,"additions":542,"deletions":61,"changed_files":22}}
{"actor":{"display_login":"gsps"}}