{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/4675","labels_url":"https://api.github.com/repos/scala/scala/issues/4675/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/4675/comments","events_url":"https://api.github.com/repos/scala/scala/issues/4675/events","html_url":"https://github.com/scala/scala/pull/4675","id":98329096,"number":4675,"title":"SI-9425 Leave Companion.apply if constructor is less accessible","user":{"login":"retronym","id":65551,"avatar_url":"https://avatars.githubusercontent.com/u/65551?v=3","gravatar_id":"","url":"https://api.github.com/users/retronym","html_url":"https://github.com/retronym","followers_url":"https://api.github.com/users/retronym/followers","following_url":"https://api.github.com/users/retronym/following{/other_user}","gists_url":"https://api.github.com/users/retronym/gists{/gist_id}","starred_url":"https://api.github.com/users/retronym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retronym/subscriptions","organizations_url":"https://api.github.com/users/retronym/orgs","repos_url":"https://api.github.com/users/retronym/repos","events_url":"https://api.github.com/users/retronym/events{/privacy}","received_events_url":"https://api.github.com/users/retronym/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/49","html_url":"https://github.com/scala/scala/milestones/2.11.8","labels_url":"https://api.github.com/repos/scala/scala/milestones/49/labels","id":1169165,"number":49,"title":"2.11.8","description":"Merge to 2.11.x.\r\n","creator":{"login":"SethTisue","id":161079,"avatar_url":"https://avatars.githubusercontent.com/u/161079?v=3","gravatar_id":"","url":"https://api.github.com/users/SethTisue","html_url":"https://github.com/SethTisue","followers_url":"https://api.github.com/users/SethTisue/followers","following_url":"https://api.github.com/users/SethTisue/following{/other_user}","gists_url":"https://api.github.com/users/SethTisue/gists{/gist_id}","starred_url":"https://api.github.com/users/SethTisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SethTisue/subscriptions","organizations_url":"https://api.github.com/users/SethTisue/orgs","repos_url":"https://api.github.com/users/SethTisue/repos","events_url":"https://api.github.com/users/SethTisue/events{/privacy}","received_events_url":"https://api.github.com/users/SethTisue/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":50,"state":"open","created_at":"2015-06-17T19:08:28Z","updated_at":"2015-07-31T06:59:18Z","due_on":"2015-09-21T07:00:00Z","closed_at":null},"comments":2,"created_at":"2015-07-31T06:59:17Z","updated_at":"2015-07-31T07:23:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/4675","html_url":"https://github.com/scala/scala/pull/4675","diff_url":"https://github.com/scala/scala/pull/4675.diff","patch_url":"https://github.com/scala/scala/pull/4675.patch"},"body":"Calls to synthetic case class apply methods are inlined to the\r\nunderlying constructor invocation in refchecks.\r\n\r\nHowever, this can lead to accessibility errors if the constructor\r\nis private.\r\n\r\nThis commit ensures that the constructor is at least as accessible\r\nas the apply method before performing this tranform.\r\n\r\nI've manually checked that other the optimization still works in other\r\ncases:\r\n\r\nscala> class CaseApply { Some(42)  }\r\ndefined class CaseApply\r\n\r\n    scala> :javap -c CaseApply\r\n    Compiled from \"<console>\"\r\n    public class CaseApply {\r\n      public CaseApply();\r\n        Code:\r\n           0: aload_0\r\n           1: invokespecial #9                  // Method java/lang/Object.\"<init>\":()V\r\n           4: new           #11                 // class scala/Some\r\n           7: dup\r\n           8: bipush        42\r\n          10: invokestatic  #17                 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;\r\n          13: invokespecial #20                 // Method scala/Some.\"<init>\":(Ljava/lang/Object;)V\r\n          16: pop\r\n          17: return\r\n    }"},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/126591470","html_url":"https://github.com/scala/scala/pull/4675#issuecomment-126591470","issue_url":"https://api.github.com/repos/scala/scala/issues/4675","id":126591470,"user":{"login":"lrytz","id":119636,"avatar_url":"https://avatars.githubusercontent.com/u/119636?v=3","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":"2015-07-31T07:23:26Z","updated_at":"2015-07-31T07:23:26Z","body":"LGTM"}}