{"action":"created","comment":{"url":"https://api.github.com/repos/JetBrains/kotlin/pulls/comments/171544421","pull_request_review_id":100411692,"id":171544421,"diff_hunk":"@@ -199,15 +199,27 @@ public static boolean couldUseDirectAccessToProperty(\n         if (KotlinTypeMapper.isAccessor(property)) return false;\n \n         CodegenContext context = contextBeforeInline.getFirstCrossInlineOrNonInlineContext();\n-        // Inline functions can't use direct access because a field may not be visible at the call site\n-        if (context.isInlineMethodContext()) {\n+        // Inline functions or inline classes can't use direct access because a field may not be visible at the call site\n+        if (context.isInlineMethodContext() || (context.getEnclosingClass() != null && context.getEnclosingClass().isInline())) {\n             return false;\n         }\n \n+        DeclarationDescriptor propertyContainingDeclaration = property.getContainingDeclaration();\n+        boolean isCompanionPropBackedInOuter = DescriptorUtils.isCompanionObject(propertyContainingDeclaration) &&","path":"compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java","position":null,"original_position":12,"commit_id":"dfe6bdeaf2400f8e9d84226fbde21ca671fbb016","original_commit_id":"0362a2c8e753fd79d0a0cb80326dded65704d189","user":{"login":"mikaelpeltier","id":12774819,"avatar_url":"https://avatars3.githubusercontent.com/u/12774819?v=4","gravatar_id":"","url":"https://api.github.com/users/mikaelpeltier","html_url":"https://github.com/mikaelpeltier","followers_url":"https://api.github.com/users/mikaelpeltier/followers","following_url":"https://api.github.com/users/mikaelpeltier/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpeltier/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpeltier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpeltier/subscriptions","organizations_url":"https://api.github.com/users/mikaelpeltier/orgs","repos_url":"https://api.github.com/users/mikaelpeltier/repos","events_url":"https://api.github.com/users/mikaelpeltier/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpeltier/received_events","type":"User","site_admin":false},"body":"I removed the code and update `isCallInsideSameClassAsDeclared` which seems a better way to solve the problem.","created_at":"2018-03-01T12:33:15Z","updated_at":"2018-03-01T13:04:17Z","html_url":"https://github.com/JetBrains/kotlin/pull/1537#discussion_r171544421","pull_request_url":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/JetBrains/kotlin/pulls/comments/171544421"},"html":{"href":"https://github.com/JetBrains/kotlin/pull/1537#discussion_r171544421"},"pull_request":{"href":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537"}},"in_reply_to_id":170901591},"pull_request":{"url":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537","id":171313371,"html_url":"https://github.com/JetBrains/kotlin/pull/1537","diff_url":"https://github.com/JetBrains/kotlin/pull/1537.diff","patch_url":"https://github.com/JetBrains/kotlin/pull/1537.patch","issue_url":"https://api.github.com/repos/JetBrains/kotlin/issues/1537","number":1537,"state":"open","locked":false,"title":"KT-14258 Optimize accesses to private properties defined into companion","user":{"login":"mikaelpeltier","id":12774819,"avatar_url":"https://avatars3.githubusercontent.com/u/12774819?v=4","gravatar_id":"","url":"https://api.github.com/users/mikaelpeltier","html_url":"https://github.com/mikaelpeltier","followers_url":"https://api.github.com/users/mikaelpeltier/followers","following_url":"https://api.github.com/users/mikaelpeltier/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpeltier/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpeltier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpeltier/subscriptions","organizations_url":"https://api.github.com/users/mikaelpeltier/orgs","repos_url":"https://api.github.com/users/mikaelpeltier/repos","events_url":"https://api.github.com/users/mikaelpeltier/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpeltier/received_events","type":"User","site_admin":false},"body":"KT-14258 Optimize accesses to private properties defined into companion\r\n\r\n- Use direct access to property defined into companion object when\r\nit is possible rather than always use an accessor to access the property.\r\n- Use direct access will speedup runtime performance.\r\n- Avoid to generate accessors when they are not used to generate smaller code.\r\n- Adapt some tests that expect getter and setter to be generated.\r\n\r\nFix of https://youtrack.jetbrains.com/issue/KT-14258","created_at":"2018-02-26T08:54:19Z","updated_at":"2018-03-01T13:04:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ad40da8b3bc6f3654f442d981b071338a83e8cc","assignee":{"login":"udalov","id":292714,"avatar_url":"https://avatars3.githubusercontent.com/u/292714?v=4","gravatar_id":"","url":"https://api.github.com/users/udalov","html_url":"https://github.com/udalov","followers_url":"https://api.github.com/users/udalov/followers","following_url":"https://api.github.com/users/udalov/following{/other_user}","gists_url":"https://api.github.com/users/udalov/gists{/gist_id}","starred_url":"https://api.github.com/users/udalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/udalov/subscriptions","organizations_url":"https://api.github.com/users/udalov/orgs","repos_url":"https://api.github.com/users/udalov/repos","events_url":"https://api.github.com/users/udalov/events{/privacy}","received_events_url":"https://api.github.com/users/udalov/received_events","type":"User","site_admin":false},"assignees":[{"login":"udalov","id":292714,"avatar_url":"https://avatars3.githubusercontent.com/u/292714?v=4","gravatar_id":"","url":"https://api.github.com/users/udalov","html_url":"https://github.com/udalov","followers_url":"https://api.github.com/users/udalov/followers","following_url":"https://api.github.com/users/udalov/following{/other_user}","gists_url":"https://api.github.com/users/udalov/gists{/gist_id}","starred_url":"https://api.github.com/users/udalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/udalov/subscriptions","organizations_url":"https://api.github.com/users/udalov/orgs","repos_url":"https://api.github.com/users/udalov/repos","events_url":"https://api.github.com/users/udalov/events{/privacy}","received_events_url":"https://api.github.com/users/udalov/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537/commits","review_comments_url":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537/comments","review_comment_url":"https://api.github.com/repos/JetBrains/kotlin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JetBrains/kotlin/issues/1537/comments","statuses_url":"https://api.github.com/repos/JetBrains/kotlin/statuses/dfe6bdeaf2400f8e9d84226fbde21ca671fbb016","head":{"label":"mikaelpeltier:mike-kt14258","ref":"mike-kt14258","sha":"dfe6bdeaf2400f8e9d84226fbde21ca671fbb016","user":{"login":"mikaelpeltier","id":12774819,"avatar_url":"https://avatars3.githubusercontent.com/u/12774819?v=4","gravatar_id":"","url":"https://api.github.com/users/mikaelpeltier","html_url":"https://github.com/mikaelpeltier","followers_url":"https://api.github.com/users/mikaelpeltier/followers","following_url":"https://api.github.com/users/mikaelpeltier/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpeltier/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpeltier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpeltier/subscriptions","organizations_url":"https://api.github.com/users/mikaelpeltier/orgs","repos_url":"https://api.github.com/users/mikaelpeltier/repos","events_url":"https://api.github.com/users/mikaelpeltier/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpeltier/received_events","type":"User","site_admin":false},"repo":{"id":119408153,"name":"kotlin","full_name":"mikaelpeltier/kotlin","owner":{"login":"mikaelpeltier","id":12774819,"avatar_url":"https://avatars3.githubusercontent.com/u/12774819?v=4","gravatar_id":"","url":"https://api.github.com/users/mikaelpeltier","html_url":"https://github.com/mikaelpeltier","followers_url":"https://api.github.com/users/mikaelpeltier/followers","following_url":"https://api.github.com/users/mikaelpeltier/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpeltier/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpeltier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpeltier/subscriptions","organizations_url":"https://api.github.com/users/mikaelpeltier/orgs","repos_url":"https://api.github.com/users/mikaelpeltier/repos","events_url":"https://api.github.com/users/mikaelpeltier/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpeltier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikaelpeltier/kotlin","description":"The Kotlin Programming Language","fork":true,"url":"https://api.github.com/repos/mikaelpeltier/kotlin","forks_url":"https://api.github.com/repos/mikaelpeltier/kotlin/forks","keys_url":"https://api.github.com/repos/mikaelpeltier/kotlin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikaelpeltier/kotlin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikaelpeltier/kotlin/teams","hooks_url":"https://api.github.com/repos/mikaelpeltier/kotlin/hooks","issue_events_url":"https://api.github.com/repos/mikaelpeltier/kotlin/issues/events{/number}","events_url":"https://api.github.com/repos/mikaelpeltier/kotlin/events","assignees_url":"https://api.github.com/repos/mikaelpeltier/kotlin/assignees{/user}","branches_url":"https://api.github.com/repos/mikaelpeltier/kotlin/branches{/branch}","tags_url":"https://api.github.com/repos/mikaelpeltier/kotlin/tags","blobs_url":"https://api.github.com/repos/mikaelpeltier/kotlin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikaelpeltier/kotlin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikaelpeltier/kotlin/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikaelpeltier/kotlin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikaelpeltier/kotlin/statuses/{sha}","languages_url":"https://api.github.com/repos/mikaelpeltier/kotlin/languages","stargazers_url":"https://api.github.com/repos/mikaelpeltier/kotlin/stargazers","contributors_url":"https://api.github.com/repos/mikaelpeltier/kotlin/contributors","subscribers_url":"https://api.github.com/repos/mikaelpeltier/kotlin/subscribers","subscription_url":"https://api.github.com/repos/mikaelpeltier/kotlin/subscription","commits_url":"https://api.github.com/repos/mikaelpeltier/kotlin/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikaelpeltier/kotlin/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikaelpeltier/kotlin/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikaelpeltier/kotlin/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikaelpeltier/kotlin/contents/{+path}","compare_url":"https://api.github.com/repos/mikaelpeltier/kotlin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikaelpeltier/kotlin/merges","archive_url":"https://api.github.com/repos/mikaelpeltier/kotlin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikaelpeltier/kotlin/downloads","issues_url":"https://api.github.com/repos/mikaelpeltier/kotlin/issues{/number}","pulls_url":"https://api.github.com/repos/mikaelpeltier/kotlin/pulls{/number}","milestones_url":"https://api.github.com/repos/mikaelpeltier/kotlin/milestones{/number}","notifications_url":"https://api.github.com/repos/mikaelpeltier/kotlin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikaelpeltier/kotlin/labels{/name}","releases_url":"https://api.github.com/repos/mikaelpeltier/kotlin/releases{/id}","deployments_url":"https://api.github.com/repos/mikaelpeltier/kotlin/deployments","created_at":"2018-01-29T16:23:10Z","updated_at":"2018-01-29T16:24:41Z","pushed_at":"2018-03-01T12:23:57Z","git_url":"git://github.com/mikaelpeltier/kotlin.git","ssh_url":"git@github.com:mikaelpeltier/kotlin.git","clone_url":"https://github.com/mikaelpeltier/kotlin.git","svn_url":"https://github.com/mikaelpeltier/kotlin","homepage":"http://kotlinlang.org/","size":440971,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JetBrains:master","ref":"master","sha":"be961b458dc245ef35498a0ad1f213b7bad38d28","user":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars2.githubusercontent.com/u/878437?v=4","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"repo":{"id":3432266,"name":"kotlin","full_name":"JetBrains/kotlin","owner":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars2.githubusercontent.com/u/878437?v=4","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JetBrains/kotlin","description":"The Kotlin Programming Language","fork":false,"url":"https://api.github.com/repos/JetBrains/kotlin","forks_url":"https://api.github.com/repos/JetBrains/kotlin/forks","keys_url":"https://api.github.com/repos/JetBrains/kotlin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JetBrains/kotlin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JetBrains/kotlin/teams","hooks_url":"https://api.github.com/repos/JetBrains/kotlin/hooks","issue_events_url":"https://api.github.com/repos/JetBrains/kotlin/issues/events{/number}","events_url":"https://api.github.com/repos/JetBrains/kotlin/events","assignees_url":"https://api.github.com/repos/JetBrains/kotlin/assignees{/user}","branches_url":"https://api.github.com/repos/JetBrains/kotlin/branches{/branch}","tags_url":"https://api.github.com/repos/JetBrains/kotlin/tags","blobs_url":"https://api.github.com/repos/JetBrains/kotlin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JetBrains/kotlin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JetBrains/kotlin/git/refs{/sha}","trees_url":"https://api.github.com/repos/JetBrains/kotlin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JetBrains/kotlin/statuses/{sha}","languages_url":"https://api.github.com/repos/JetBrains/kotlin/languages","stargazers_url":"https://api.github.com/repos/JetBrains/kotlin/stargazers","contributors_url":"https://api.github.com/repos/JetBrains/kotlin/contributors","subscribers_url":"https://api.github.com/repos/JetBrains/kotlin/subscribers","subscription_url":"https://api.github.com/repos/JetBrains/kotlin/subscription","commits_url":"https://api.github.com/repos/JetBrains/kotlin/commits{/sha}","git_commits_url":"https://api.github.com/repos/JetBrains/kotlin/git/commits{/sha}","comments_url":"https://api.github.com/repos/JetBrains/kotlin/comments{/number}","issue_comment_url":"https://api.github.com/repos/JetBrains/kotlin/issues/comments{/number}","contents_url":"https://api.github.com/repos/JetBrains/kotlin/contents/{+path}","compare_url":"https://api.github.com/repos/JetBrains/kotlin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JetBrains/kotlin/merges","archive_url":"https://api.github.com/repos/JetBrains/kotlin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JetBrains/kotlin/downloads","issues_url":"https://api.github.com/repos/JetBrains/kotlin/issues{/number}","pulls_url":"https://api.github.com/repos/JetBrains/kotlin/pulls{/number}","milestones_url":"https://api.github.com/repos/JetBrains/kotlin/milestones{/number}","notifications_url":"https://api.github.com/repos/JetBrains/kotlin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JetBrains/kotlin/labels{/name}","releases_url":"https://api.github.com/repos/JetBrains/kotlin/releases{/id}","deployments_url":"https://api.github.com/repos/JetBrains/kotlin/deployments","created_at":"2012-02-13T17:29:58Z","updated_at":"2018-03-01T09:56:22Z","pushed_at":"2018-03-01T13:04:12Z","git_url":"git://github.com/JetBrains/kotlin.git","ssh_url":"git@github.com:JetBrains/kotlin.git","clone_url":"https://github.com/JetBrains/kotlin.git","svn_url":"https://github.com/JetBrains/kotlin","homepage":"http://kotlinlang.org/","size":442197,"stargazers_count":21107,"watchers_count":21107,"language":"Kotlin","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2316,"mirror_url":null,"archived":false,"open_issues_count":71,"license":null,"forks":2316,"open_issues":71,"watchers":21107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537"},"html":{"href":"https://github.com/JetBrains/kotlin/pull/1537"},"issue":{"href":"https://api.github.com/repos/JetBrains/kotlin/issues/1537"},"comments":{"href":"https://api.github.com/repos/JetBrains/kotlin/issues/1537/comments"},"review_comments":{"href":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537/comments"},"review_comment":{"href":"https://api.github.com/repos/JetBrains/kotlin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JetBrains/kotlin/pulls/1537/commits"},"statuses":{"href":"https://api.github.com/repos/JetBrains/kotlin/statuses/dfe6bdeaf2400f8e9d84226fbde21ca671fbb016"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mikaelpeltier"}}