{"action":"closed","number":6088,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/6088","id":141816915,"node_id":"MDExOlB1bGxSZXF1ZXN0MTQxODE2OTE1","html_url":"https://github.com/scala/scala/pull/6088","diff_url":"https://github.com/scala/scala/pull/6088.diff","patch_url":"https://github.com/scala/scala/pull/6088.patch","issue_url":"https://api.github.com/repos/scala/scala/issues/6088","number":6088,"state":"closed","locked":false,"title":"Translate a virtual call on sealed trait/class with a single concrete subclass to a virtual call on that subclass.","user":{"login":"TomasMikula","id":433439,"node_id":"MDQ6VXNlcjQzMzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/433439?v=4","gravatar_id":"","url":"https://api.github.com/users/TomasMikula","html_url":"https://github.com/TomasMikula","followers_url":"https://api.github.com/users/TomasMikula/followers","following_url":"https://api.github.com/users/TomasMikula/following{/other_user}","gists_url":"https://api.github.com/users/TomasMikula/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasMikula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasMikula/subscriptions","organizations_url":"https://api.github.com/users/TomasMikula/orgs","repos_url":"https://api.github.com/users/TomasMikula/repos","events_url":"https://api.github.com/users/TomasMikula/events{/privacy}","received_events_url":"https://api.github.com/users/TomasMikula/received_events","type":"User","site_admin":false},"body":"Translate a virtual call on sealed trait/class with a single concrete subclass to a virtual call on that subclass.\r\n\r\nThis enables the call to later be inlined.\r\n\r\nAs an example, consider\r\n\r\n```scala\r\nsealed trait Foo {\r\n  def foo(s: String): Unit\r\n}\r\n\r\nclass FooImpl extends Foo {\r\n  @inline\r\n  final def foo(s: String): Unit = ()\r\n}\r\n\r\nclass Test extends {\r\n  def go(f: Foo): Unit = f.foo(\"Hi\")\r\n}\r\n```\r\n\r\nWith Scala 2.12.3,\r\n```\r\nscalac -opt:l:inline '-opt-inline-from:**' -opt-warnings test.scala\r\n```\r\n\r\ncompiles the `Test#go` method to\r\n\r\n```\r\n 0: aload_1\r\n 1: ldc           #13                 // String Hi\r\n 3: invokeinterface #19,  2           // InterfaceMethod Foo.foo:(Ljava/lang/String;)V\r\n 8: return\r\n```\r\n\r\nWith this PR, `f` in `f.foo(\"Hi\")` is first cast to `FooImpl` and then a (virtual) call to `FooImpl#foo` is made. However, this virtual call to a `final` method is later inlined, resulting in the following bytecode:\r\n\r\n```\r\n 0: aload_1\r\n 1: checkcast     #13                 // class FooImpl\r\n 4: ifnonnull     9\r\n 7: aconst_null\r\n 8: athrow\r\n 9: return\r\n```","created_at":"2017-09-19T10:52:25Z","updated_at":"2018-06-01T09:33:45Z","closed_at":"2018-06-01T09:33:44Z","merged_at":null,"merge_commit_sha":"08c1cd22fc0ecda15d61de2aaf8014be4b05686d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":370564410,"node_id":"MDU6TGFiZWwzNzA1NjQ0MTA=","url":"https://api.github.com/repos/scala/scala/labels/WIP","name":"WIP","color":"f9d0c4","default":false}],"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/54","html_url":"https://github.com/scala/scala/milestone/54","labels_url":"https://api.github.com/repos/scala/scala/milestones/54/labels","id":1643773,"node_id":"MDk6TWlsZXN0b25lMTY0Mzc3Mw==","number":54,"title":"WIP","description":"Ongoing work that's not yet ready (experimentation, SIP/SLIP prototyping,..)","creator":{"login":"adriaanm","id":91083,"node_id":"MDQ6VXNlcjkxMDgz","avatar_url":"https://avatars2.githubusercontent.com/u/91083?v=4","gravatar_id":"","url":"https://api.github.com/users/adriaanm","html_url":"https://github.com/adriaanm","followers_url":"https://api.github.com/users/adriaanm/followers","following_url":"https://api.github.com/users/adriaanm/following{/other_user}","gists_url":"https://api.github.com/users/adriaanm/gists{/gist_id}","starred_url":"https://api.github.com/users/adriaanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriaanm/subscriptions","organizations_url":"https://api.github.com/users/adriaanm/orgs","repos_url":"https://api.github.com/users/adriaanm/repos","events_url":"https://api.github.com/users/adriaanm/events{/privacy}","received_events_url":"https://api.github.com/users/adriaanm/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":5,"state":"open","created_at":"2016-03-14T17:42:51Z","updated_at":"2018-06-01T09:33:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/scala/scala/pulls/6088/commits","review_comments_url":"https://api.github.com/repos/scala/scala/pulls/6088/comments","review_comment_url":"https://api.github.com/repos/scala/scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/scala/issues/6088/comments","statuses_url":"https://api.github.com/repos/scala/scala/statuses/185fa9ca2ac906bddda7e0478ec8cfdad6e1864d","head":{"label":"TomasMikula:single-impl-vcalls","ref":"single-impl-vcalls","sha":"185fa9ca2ac906bddda7e0478ec8cfdad6e1864d","user":{"login":"TomasMikula","id":433439,"node_id":"MDQ6VXNlcjQzMzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/433439?v=4","gravatar_id":"","url":"https://api.github.com/users/TomasMikula","html_url":"https://github.com/TomasMikula","followers_url":"https://api.github.com/users/TomasMikula/followers","following_url":"https://api.github.com/users/TomasMikula/following{/other_user}","gists_url":"https://api.github.com/users/TomasMikula/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasMikula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasMikula/subscriptions","organizations_url":"https://api.github.com/users/TomasMikula/orgs","repos_url":"https://api.github.com/users/TomasMikula/repos","events_url":"https://api.github.com/users/TomasMikula/events{/privacy}","received_events_url":"https://api.github.com/users/TomasMikula/received_events","type":"User","site_admin":false},"repo":{"id":102902335,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI5MDIzMzU=","name":"scala","full_name":"TomasMikula/scala","owner":{"login":"TomasMikula","id":433439,"node_id":"MDQ6VXNlcjQzMzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/433439?v=4","gravatar_id":"","url":"https://api.github.com/users/TomasMikula","html_url":"https://github.com/TomasMikula","followers_url":"https://api.github.com/users/TomasMikula/followers","following_url":"https://api.github.com/users/TomasMikula/following{/other_user}","gists_url":"https://api.github.com/users/TomasMikula/gists{/gist_id}","starred_url":"https://api.github.com/users/TomasMikula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomasMikula/subscriptions","organizations_url":"https://api.github.com/users/TomasMikula/orgs","repos_url":"https://api.github.com/users/TomasMikula/repos","events_url":"https://api.github.com/users/TomasMikula/events{/privacy}","received_events_url":"https://api.github.com/users/TomasMikula/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TomasMikula/scala","description":"The Scala programming language","fork":true,"url":"https://api.github.com/repos/TomasMikula/scala","forks_url":"https://api.github.com/repos/TomasMikula/scala/forks","keys_url":"https://api.github.com/repos/TomasMikula/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TomasMikula/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TomasMikula/scala/teams","hooks_url":"https://api.github.com/repos/TomasMikula/scala/hooks","issue_events_url":"https://api.github.com/repos/TomasMikula/scala/issues/events{/number}","events_url":"https://api.github.com/repos/TomasMikula/scala/events","assignees_url":"https://api.github.com/repos/TomasMikula/scala/assignees{/user}","branches_url":"https://api.github.com/repos/TomasMikula/scala/branches{/branch}","tags_url":"https://api.github.com/repos/TomasMikula/scala/tags","blobs_url":"https://api.github.com/repos/TomasMikula/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TomasMikula/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TomasMikula/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/TomasMikula/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TomasMikula/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/TomasMikula/scala/languages","stargazers_url":"https://api.github.com/repos/TomasMikula/scala/stargazers","contributors_url":"https://api.github.com/repos/TomasMikula/scala/contributors","subscribers_url":"https://api.github.com/repos/TomasMikula/scala/subscribers","subscription_url":"https://api.github.com/repos/TomasMikula/scala/subscription","commits_url":"https://api.github.com/repos/TomasMikula/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/TomasMikula/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/TomasMikula/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/TomasMikula/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/TomasMikula/scala/contents/{+path}","compare_url":"https://api.github.com/repos/TomasMikula/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TomasMikula/scala/merges","archive_url":"https://api.github.com/repos/TomasMikula/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TomasMikula/scala/downloads","issues_url":"https://api.github.com/repos/TomasMikula/scala/issues{/number}","pulls_url":"https://api.github.com/repos/TomasMikula/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/TomasMikula/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/TomasMikula/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TomasMikula/scala/labels{/name}","releases_url":"https://api.github.com/repos/TomasMikula/scala/releases{/id}","deployments_url":"https://api.github.com/repos/TomasMikula/scala/deployments","created_at":"2017-09-08T20:35:10Z","updated_at":"2017-09-08T20:35:26Z","pushed_at":"2017-09-29T11:26:23Z","git_url":"git://github.com/TomasMikula/scala.git","ssh_url":"git@github.com:TomasMikula/scala.git","clone_url":"https://github.com/TomasMikula/scala.git","svn_url":"https://github.com/TomasMikula/scala","homepage":"http://www.scala-lang.org/","size":87513,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.12.x"}},"base":{"label":"scala:2.12.x","ref":"2.12.x","sha":"07310fa675304cfce82dc830e980758cbcec3292","user":{"login":"scala","id":57059,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MDU5","avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"repo":{"id":2888818,"node_id":"MDEwOlJlcG9zaXRvcnkyODg4ODE4","name":"scala","full_name":"scala/scala","owner":{"login":"scala","id":57059,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MDU5","avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala/scala","description":"The Scala programming language","fork":false,"url":"https://api.github.com/repos/scala/scala","forks_url":"https://api.github.com/repos/scala/scala/forks","keys_url":"https://api.github.com/repos/scala/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala/scala/teams","hooks_url":"https://api.github.com/repos/scala/scala/hooks","issue_events_url":"https://api.github.com/repos/scala/scala/issues/events{/number}","events_url":"https://api.github.com/repos/scala/scala/events","assignees_url":"https://api.github.com/repos/scala/scala/assignees{/user}","branches_url":"https://api.github.com/repos/scala/scala/branches{/branch}","tags_url":"https://api.github.com/repos/scala/scala/tags","blobs_url":"https://api.github.com/repos/scala/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/scala/scala/languages","stargazers_url":"https://api.github.com/repos/scala/scala/stargazers","contributors_url":"https://api.github.com/repos/scala/scala/contributors","subscribers_url":"https://api.github.com/repos/scala/scala/subscribers","subscription_url":"https://api.github.com/repos/scala/scala/subscription","commits_url":"https://api.github.com/repos/scala/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala/scala/contents/{+path}","compare_url":"https://api.github.com/repos/scala/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala/scala/merges","archive_url":"https://api.github.com/repos/scala/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala/scala/downloads","issues_url":"https://api.github.com/repos/scala/scala/issues{/number}","pulls_url":"https://api.github.com/repos/scala/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/scala/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/scala/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala/scala/labels{/name}","releases_url":"https://api.github.com/repos/scala/scala/releases{/id}","deployments_url":"https://api.github.com/repos/scala/scala/deployments","created_at":"2011-12-01T05:02:34Z","updated_at":"2018-06-01T09:22:25Z","pushed_at":"2018-06-01T09:22:14Z","git_url":"git://github.com/scala/scala.git","ssh_url":"git@github.com:scala/scala.git","clone_url":"https://github.com/scala/scala.git","svn_url":"https://github.com/scala/scala","homepage":"http://www.scala-lang.org/","size":97979,"stargazers_count":10255,"watchers_count":10255,"language":"Scala","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2434,"mirror_url":null,"archived":false,"open_issues_count":91,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":2434,"open_issues":91,"watchers":10255,"default_branch":"2.13.x"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/6088"},"html":{"href":"https://github.com/scala/scala/pull/6088"},"issue":{"href":"https://api.github.com/repos/scala/scala/issues/6088"},"comments":{"href":"https://api.github.com/repos/scala/scala/issues/6088/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/scala/pulls/6088/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/scala/pulls/6088/commits"},"statuses":{"href":"https://api.github.com/repos/scala/scala/statuses/185fa9ca2ac906bddda7e0478ec8cfdad6e1864d"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":11,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":41,"deletions":5,"changed_files":2}}
{"actor":{"display_login":"adriaanm"}}