{"action":"created","comment":{"url":"https://api.github.com/repos/scala/scala/pulls/comments/74560916","id":74560916,"diff_hunk":"@@ -0,0 +1,3 @@\n+object Test {\n+  (new Q.Inner).foo // make sure foo's type is well-formed","path":"test/files/pos/t2377b/a.scala","position":2,"original_position":2,"commit_id":"708dd680b3e28c6344c3f45c2aea09cf1d3b5908","original_commit_id":"d59de7d571c503064d3d2ad0db3312b9e6793616","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},"body":"This closer, but still not quite right.\r\n\r\n```\r\ndiff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala\r\nindex 16ef75c..cb432e3 100644\r\n--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala\r\n+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala\r\n@@ -1016,13 +1016,22 @@ trait Contexts { self: Analyzer =>\r\n           || unit.exists && s.sourceFile != unit.source.file\r\n         )\r\n       )\r\n-      def lookupInPrefix(name: Name)    = pre member name filter qualifies\r\n+      def lookupInPrefix(name: Name)    = {\r\n+        val sym = pre.member(name).filter(qualifies)\r\n+        def isNonPackageNoModuleClass(sym: Symbol) =\r\n+          sym.isClass && !sym.isModuleClass && !sym.isPackageClass\r\n+        if (!sym.exists && unit.isJava && isNonPackageNoModuleClass(pre.typeSymbol)) {\r\n+          val found = companionSymbolOf(pre.typeSymbol, this).typeOfThis.member(name).filter(qualifies)\r\n+          if (found.exists) pre = companionSymbolOf(pre.typeSymbol, this).typeOfThis\r\n+          found\r\n+        } else sym\r\n+      }\r\n       def accessibleInPrefix(s: Symbol) = isAccessible(s, pre, superAccess = false)\r\n \r\n       def searchPrefix = {\r\n         cx = cx.enclClass\r\n         val found0 = lookupInPrefix(name)\r\n-        val found1 = found0 filter accessibleInPrefix\r\n+        var found1 = found0 filter accessibleInPrefix\r\n         if (found0.exists && !found1.exists && inaccessible == null)\r\n           inaccessible = LookupInaccessible(found0, analyzer.lastAccessCheckDetails)\r\n \r\ndiff --git a/test/files/pos/t2377b/a.scala b/test/files/pos/t2377b/a.scala\r\nindex 14be23c..5b0b655 100644\r\n--- a/test/files/pos/t2377b/a.scala\r\n+++ b/test/files/pos/t2377b/a.scala\r\n@@ -1,3 +1,3 @@\r\n object Test {\r\n-  (new Q.Inner).foo // make sure foo's type is well-formed\r\n+  (new Q.Inner).foo.innerMethod // make sure foo's type is well-formed\r\n }\r\n```","created_at":"2016-08-12T09:03:51Z","updated_at":"2016-08-12T09:03:51Z","html_url":"https://github.com/scala/scala/pull/5304#discussion_r74560916","pull_request_url":"https://api.github.com/repos/scala/scala/pulls/5304","_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/comments/74560916"},"html":{"href":"https://github.com/scala/scala/pull/5304#discussion_r74560916"},"pull_request":{"href":"https://api.github.com/repos/scala/scala/pulls/5304"}}},"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/5304","id":78905572,"html_url":"https://github.com/scala/scala/pull/5304","diff_url":"https://github.com/scala/scala/pull/5304.diff","patch_url":"https://github.com/scala/scala/pull/5304.patch","issue_url":"https://api.github.com/repos/scala/scala/issues/5304","number":5304,"state":"open","locked":false,"title":"SI-4826 Fixes to javadoc [ci: last-only]","user":{"login":"jodersky","id":1007012,"avatar_url":"https://avatars.githubusercontent.com/u/1007012?v=3","gravatar_id":"","url":"https://api.github.com/users/jodersky","html_url":"https://github.com/jodersky","followers_url":"https://api.github.com/users/jodersky/followers","following_url":"https://api.github.com/users/jodersky/following{/other_user}","gists_url":"https://api.github.com/users/jodersky/gists{/gist_id}","starred_url":"https://api.github.com/users/jodersky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodersky/subscriptions","organizations_url":"https://api.github.com/users/jodersky/orgs","repos_url":"https://api.github.com/users/jodersky/repos","events_url":"https://api.github.com/users/jodersky/events{/privacy}","received_events_url":"https://api.github.com/users/jodersky/received_events","type":"User","site_admin":false},"body":"Some issues were discovered in my last contribution #5246 through the community build. This PR aims to solve them.\r\n\r\nPosting this as a WIP so I can get a discussion going with the compiler maintainers, specifically @adriaanm and @VladUreche \r\n\r\nIssues to be fixed:\r\n\r\n- [x] A doc comment in head position (such as a copyright header) will crash the compiler with an NPE, due to the way the javadoc analyzer is initialised. Fixed (thanks @adriaanm)\r\n- [x] Documented java fields fail. Fixed in latest commit\r\n- [x] Interfaces cause problems due to methods being placed into companion objects\r\n- [x] Comments on constructors lead to double definition of constructor symbol\r\n- [x] Ambiguous reference error to same-named objects defined in outer and inner classes (thanks @adriaanm)","created_at":"2016-07-26T18:56:50Z","updated_at":"2016-08-12T09:03:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67743181d02cbd1fa7ae6c6ddd7d7c617f00c3a6","assignee":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","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},"assignees":[{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","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}],"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/47","html_url":"https://github.com/scala/scala/milestones/2.12.0-RC1","labels_url":"https://api.github.com/repos/scala/scala/milestones/47/labels","id":977200,"number":47,"title":"2.12.0-RC1","description":"The PR queue for RC1 is now closed. We'll release as soon as the all PRs have been reviewed and merged, hopefully by mid August. [Discussion](https://groups.google.com/d/msg/scala-internals/hxDjZfm1h3c/Y5OkHdatAAAJ)\r\n\r\nWe will merge 2.12.0 into the 2.12.x branch, so that 2.12.1 development can continue during the RC cycle.\r\n\r\nLead: @adriaanm\r\n\r\nMerge to 2.12.0.","creator":{"login":"adriaanm","id":91083,"avatar_url":"https://avatars.githubusercontent.com/u/91083?v=3","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":20,"closed_issues":54,"state":"open","created_at":"2015-02-12T17:53:06Z","updated_at":"2016-08-12T00:53:26Z","due_on":"2016-08-22T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scala/scala/pulls/5304/commits","review_comments_url":"https://api.github.com/repos/scala/scala/pulls/5304/comments","review_comment_url":"https://api.github.com/repos/scala/scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/scala/issues/5304/comments","statuses_url":"https://api.github.com/repos/scala/scala/statuses/708dd680b3e28c6344c3f45c2aea09cf1d3b5908","head":{"label":"jodersky:javadoc","ref":"javadoc","sha":"708dd680b3e28c6344c3f45c2aea09cf1d3b5908","user":{"login":"jodersky","id":1007012,"avatar_url":"https://avatars.githubusercontent.com/u/1007012?v=3","gravatar_id":"","url":"https://api.github.com/users/jodersky","html_url":"https://github.com/jodersky","followers_url":"https://api.github.com/users/jodersky/followers","following_url":"https://api.github.com/users/jodersky/following{/other_user}","gists_url":"https://api.github.com/users/jodersky/gists{/gist_id}","starred_url":"https://api.github.com/users/jodersky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodersky/subscriptions","organizations_url":"https://api.github.com/users/jodersky/orgs","repos_url":"https://api.github.com/users/jodersky/repos","events_url":"https://api.github.com/users/jodersky/events{/privacy}","received_events_url":"https://api.github.com/users/jodersky/received_events","type":"User","site_admin":false},"repo":{"id":56000113,"name":"scala","full_name":"jodersky/scala","owner":{"login":"jodersky","id":1007012,"avatar_url":"https://avatars.githubusercontent.com/u/1007012?v=3","gravatar_id":"","url":"https://api.github.com/users/jodersky","html_url":"https://github.com/jodersky","followers_url":"https://api.github.com/users/jodersky/followers","following_url":"https://api.github.com/users/jodersky/following{/other_user}","gists_url":"https://api.github.com/users/jodersky/gists{/gist_id}","starred_url":"https://api.github.com/users/jodersky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodersky/subscriptions","organizations_url":"https://api.github.com/users/jodersky/orgs","repos_url":"https://api.github.com/users/jodersky/repos","events_url":"https://api.github.com/users/jodersky/events{/privacy}","received_events_url":"https://api.github.com/users/jodersky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jodersky/scala","description":"The Scala programming language","fork":true,"url":"https://api.github.com/repos/jodersky/scala","forks_url":"https://api.github.com/repos/jodersky/scala/forks","keys_url":"https://api.github.com/repos/jodersky/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jodersky/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jodersky/scala/teams","hooks_url":"https://api.github.com/repos/jodersky/scala/hooks","issue_events_url":"https://api.github.com/repos/jodersky/scala/issues/events{/number}","events_url":"https://api.github.com/repos/jodersky/scala/events","assignees_url":"https://api.github.com/repos/jodersky/scala/assignees{/user}","branches_url":"https://api.github.com/repos/jodersky/scala/branches{/branch}","tags_url":"https://api.github.com/repos/jodersky/scala/tags","blobs_url":"https://api.github.com/repos/jodersky/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jodersky/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jodersky/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/jodersky/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jodersky/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/jodersky/scala/languages","stargazers_url":"https://api.github.com/repos/jodersky/scala/stargazers","contributors_url":"https://api.github.com/repos/jodersky/scala/contributors","subscribers_url":"https://api.github.com/repos/jodersky/scala/subscribers","subscription_url":"https://api.github.com/repos/jodersky/scala/subscription","commits_url":"https://api.github.com/repos/jodersky/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/jodersky/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/jodersky/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/jodersky/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/jodersky/scala/contents/{+path}","compare_url":"https://api.github.com/repos/jodersky/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jodersky/scala/merges","archive_url":"https://api.github.com/repos/jodersky/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jodersky/scala/downloads","issues_url":"https://api.github.com/repos/jodersky/scala/issues{/number}","pulls_url":"https://api.github.com/repos/jodersky/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/jodersky/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/jodersky/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jodersky/scala/labels{/name}","releases_url":"https://api.github.com/repos/jodersky/scala/releases{/id}","deployments_url":"https://api.github.com/repos/jodersky/scala/deployments","created_at":"2016-04-11T19:14:43Z","updated_at":"2016-04-11T19:14:57Z","pushed_at":"2016-08-11T18:18:19Z","git_url":"git://github.com/jodersky/scala.git","ssh_url":"git@github.com:jodersky/scala.git","clone_url":"https://github.com/jodersky/scala.git","svn_url":"https://github.com/jodersky/scala","homepage":"http://www.scala-lang.org/","size":77473,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.12.x"}},"base":{"label":"scala:2.12.x","ref":"2.12.x","sha":"910d2dbdb39288391441c009d802132350269fe6","user":{"login":"scala","id":57059,"avatar_url":"https://avatars.githubusercontent.com/u/57059?v=3","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,"name":"scala","full_name":"scala/scala","owner":{"login":"scala","id":57059,"avatar_url":"https://avatars.githubusercontent.com/u/57059?v=3","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":"2016-08-12T03:20:00Z","pushed_at":"2016-08-12T00:00:28Z","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":135604,"stargazers_count":6639,"watchers_count":6639,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1673,"mirror_url":null,"open_issues_count":58,"forks":1673,"open_issues":58,"watchers":6639,"default_branch":"2.12.x"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/5304"},"html":{"href":"https://github.com/scala/scala/pull/5304"},"issue":{"href":"https://api.github.com/repos/scala/scala/issues/5304"},"comments":{"href":"https://api.github.com/repos/scala/scala/issues/5304/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/scala/pulls/5304/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/scala/pulls/5304/commits"},"statuses":{"href":"https://api.github.com/repos/scala/scala/statuses/708dd680b3e28c6344c3f45c2aea09cf1d3b5908"}}}}
{"actor":{"display_login":"retronym"}}