{"action":"created","comment":{"url":"https://api.github.com/repos/scala/scala/pulls/comments/138223032","pull_request_review_id":61989898,"id":138223032,"diff_hunk":"@@ -894,7 +894,10 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper\n \n         def cantAdapt =\n           if (context.implicitsEnabled) MissingArgsForMethodTpeError(tree, meth)","path":"src/compiler/scala/tools/nsc/typechecker/Typers.scala","position":3,"original_position":3,"commit_id":"eec156250d22cdc97dbeb0c66263ff3da74b1268","original_commit_id":"eec156250d22cdc97dbeb0c66263ff3da74b1268","user":{"login":"adriaanm","id":91083,"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},"body":"Nice exploration :-)  Agreed on stability -- not really the best thing to complain about here. Oh scalac.","created_at":"2017-09-12T00:02:51Z","updated_at":"2017-09-12T00:02:52Z","html_url":"https://github.com/scala/scala/pull/6042#discussion_r138223032","pull_request_url":"https://api.github.com/repos/scala/scala/pulls/6042","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/comments/138223032"},"html":{"href":"https://github.com/scala/scala/pull/6042#discussion_r138223032"},"pull_request":{"href":"https://api.github.com/repos/scala/scala/pulls/6042"}},"in_reply_to_id":137668348},"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/6042","id":136617709,"html_url":"https://github.com/scala/scala/pull/6042","diff_url":"https://github.com/scala/scala/pull/6042.diff","patch_url":"https://github.com/scala/scala/pull/6042.patch","issue_url":"https://api.github.com/repos/scala/scala/issues/6042","number":6042,"state":"open","locked":false,"title":"Issue an error when trying to use a method as a qualifier.","user":{"login":"hrhino","id":28076058,"avatar_url":"https://avatars2.githubusercontent.com/u/28076058?v=4","gravatar_id":"","url":"https://api.github.com/users/hrhino","html_url":"https://github.com/hrhino","followers_url":"https://api.github.com/users/hrhino/followers","following_url":"https://api.github.com/users/hrhino/following{/other_user}","gists_url":"https://api.github.com/users/hrhino/gists{/gist_id}","starred_url":"https://api.github.com/users/hrhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrhino/subscriptions","organizations_url":"https://api.github.com/users/hrhino/orgs","repos_url":"https://api.github.com/users/hrhino/repos","events_url":"https://api.github.com/users/hrhino/events{/privacy}","received_events_url":"https://api.github.com/users/hrhino/received_events","type":"User","site_admin":false},"body":"The check for `implicitsEnabled` here seems older even than that method; it appears to originally have looked at a flag `reportGeneralErrors`, which seems a reasonable flag if you want to check whether to report an error. An erroneous tree that we do not error on, however, can be use as a qualifier which will not necessarily cause an error until past typer, when something finally notices the mistake and blows up.\r\n\r\nI tried, but I can't find how we can get to `cantAdapt` with disabled implicits other than by the tricks shown in the test case; running the partests with an assertion that at `cantAdapt` we either have `ImplicitsEnabled` or are in `QUALmode` never trips. The main un-setters of `ImplicitsEnabled` are `typedSingletonTypeTree` and `typedPattern`, which are the two at issue in this PR. \r\n\r\nI'm not completely sure about the use of `UnstableTreeError` as the error; originally I had a `CannotSelectFromMethodError` but abandoned it in light of:\r\n\r\n```\r\nscala> object Foo { def Bar(i: Int) = i }\r\ndefined object Foo\r\n\r\nscala> (??? : Any) match { case Foo.Bar.Baz => }\r\njava.lang.NullPointerException\r\n  ... elided ...\r\n\r\nscala> (??? : Any) match { case Foo.Bar => }\r\n<console>:13: error: stable identifier required, but Foo.Bar found.\r\n       (??? : Any) match { case Foo.Bar => }\r\n                                    ^\r\n\r\nscala> import Foo._\r\nimport Foo._\r\n\r\nscala> (??? : Any) match { case Bar => }\r\n<console>:16: error: stable identifier required, but Foo.Bar found.\r\n       (??? : Any) match { case Bar => }\r\n                                ^\r\n```\r\n\r\nMoreover, the relevant spec sections regarding [pattern matching](https://github.com/scala/scala/blame/v2.12.3/spec/08-pattern-matching.md#L105) and [singleton types](https://github.com/scala/scala/blame/v2.12.3/spec/03-types.md#L108) at least imply that instability is part of the problem here. I'm willing to add a new error message if this seems imprecise.\r\n\r\nFixes scala/bug#10474.","created_at":"2017-08-19T19:00:16Z","updated_at":"2017-09-12T00:02:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"711baf9993830165430718ca2153ae49cc775de0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/64","html_url":"https://github.com/scala/scala/milestone/64","labels_url":"https://api.github.com/repos/scala/scala/milestones/64/labels","id":2526022,"number":64,"title":"2.12.4","description":"Merge to 2.12.x.\r\n\r\n2.12 now in maintenance mode: non-critical work should target 2.13. Switching to 6-month cycle after 2.12.4.\r\n\r\nRelease Lead: @adriaanm","creator":{"login":"retronym","id":65551,"avatar_url":"https://avatars0.githubusercontent.com/u/65551?v=4","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},"open_issues":44,"closed_issues":42,"state":"open","created_at":"2017-05-17T04:00:00Z","updated_at":"2017-09-11T23:36:23Z","due_on":"2017-09-29T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scala/scala/pulls/6042/commits","review_comments_url":"https://api.github.com/repos/scala/scala/pulls/6042/comments","review_comment_url":"https://api.github.com/repos/scala/scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/scala/issues/6042/comments","statuses_url":"https://api.github.com/repos/scala/scala/statuses/eec156250d22cdc97dbeb0c66263ff3da74b1268","head":{"label":"hrhino:bugfix/t10474","ref":"bugfix/t10474","sha":"eec156250d22cdc97dbeb0c66263ff3da74b1268","user":{"login":"hrhino","id":28076058,"avatar_url":"https://avatars2.githubusercontent.com/u/28076058?v=4","gravatar_id":"","url":"https://api.github.com/users/hrhino","html_url":"https://github.com/hrhino","followers_url":"https://api.github.com/users/hrhino/followers","following_url":"https://api.github.com/users/hrhino/following{/other_user}","gists_url":"https://api.github.com/users/hrhino/gists{/gist_id}","starred_url":"https://api.github.com/users/hrhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrhino/subscriptions","organizations_url":"https://api.github.com/users/hrhino/orgs","repos_url":"https://api.github.com/users/hrhino/repos","events_url":"https://api.github.com/users/hrhino/events{/privacy}","received_events_url":"https://api.github.com/users/hrhino/received_events","type":"User","site_admin":false},"repo":{"id":89544857,"name":"scala","full_name":"hrhino/scala","owner":{"login":"hrhino","id":28076058,"avatar_url":"https://avatars2.githubusercontent.com/u/28076058?v=4","gravatar_id":"","url":"https://api.github.com/users/hrhino","html_url":"https://github.com/hrhino","followers_url":"https://api.github.com/users/hrhino/followers","following_url":"https://api.github.com/users/hrhino/following{/other_user}","gists_url":"https://api.github.com/users/hrhino/gists{/gist_id}","starred_url":"https://api.github.com/users/hrhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrhino/subscriptions","organizations_url":"https://api.github.com/users/hrhino/orgs","repos_url":"https://api.github.com/users/hrhino/repos","events_url":"https://api.github.com/users/hrhino/events{/privacy}","received_events_url":"https://api.github.com/users/hrhino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hrhino/scala","description":"The Scala programming language","fork":true,"url":"https://api.github.com/repos/hrhino/scala","forks_url":"https://api.github.com/repos/hrhino/scala/forks","keys_url":"https://api.github.com/repos/hrhino/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hrhino/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hrhino/scala/teams","hooks_url":"https://api.github.com/repos/hrhino/scala/hooks","issue_events_url":"https://api.github.com/repos/hrhino/scala/issues/events{/number}","events_url":"https://api.github.com/repos/hrhino/scala/events","assignees_url":"https://api.github.com/repos/hrhino/scala/assignees{/user}","branches_url":"https://api.github.com/repos/hrhino/scala/branches{/branch}","tags_url":"https://api.github.com/repos/hrhino/scala/tags","blobs_url":"https://api.github.com/repos/hrhino/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hrhino/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hrhino/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/hrhino/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hrhino/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/hrhino/scala/languages","stargazers_url":"https://api.github.com/repos/hrhino/scala/stargazers","contributors_url":"https://api.github.com/repos/hrhino/scala/contributors","subscribers_url":"https://api.github.com/repos/hrhino/scala/subscribers","subscription_url":"https://api.github.com/repos/hrhino/scala/subscription","commits_url":"https://api.github.com/repos/hrhino/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/hrhino/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/hrhino/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/hrhino/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/hrhino/scala/contents/{+path}","compare_url":"https://api.github.com/repos/hrhino/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hrhino/scala/merges","archive_url":"https://api.github.com/repos/hrhino/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hrhino/scala/downloads","issues_url":"https://api.github.com/repos/hrhino/scala/issues{/number}","pulls_url":"https://api.github.com/repos/hrhino/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/hrhino/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/hrhino/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hrhino/scala/labels{/name}","releases_url":"https://api.github.com/repos/hrhino/scala/releases{/id}","deployments_url":"https://api.github.com/repos/hrhino/scala/deployments","created_at":"2017-04-27T02:03:29Z","updated_at":"2017-04-27T02:03:46Z","pushed_at":"2017-09-05T20:44:25Z","git_url":"git://github.com/hrhino/scala.git","ssh_url":"git@github.com:hrhino/scala.git","clone_url":"https://github.com/hrhino/scala.git","svn_url":"https://github.com/hrhino/scala","homepage":"http://www.scala-lang.org/","size":87201,"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,"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":"1b7d57f2f90b2c851a5c60250c077721d01c48f8","user":{"login":"scala","id":57059,"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,"name":"scala","full_name":"scala/scala","owner":{"login":"scala","id":57059,"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":"2017-09-11T22:20:04Z","pushed_at":"2017-09-11T23:36:22Z","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":87266,"stargazers_count":8853,"watchers_count":8853,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2179,"mirror_url":null,"open_issues_count":80,"forks":2179,"open_issues":80,"watchers":8853,"default_branch":"2.12.x"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/6042"},"html":{"href":"https://github.com/scala/scala/pull/6042"},"issue":{"href":"https://api.github.com/repos/scala/scala/issues/6042"},"comments":{"href":"https://api.github.com/repos/scala/scala/issues/6042/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/scala/pulls/6042/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/scala/pulls/6042/commits"},"statuses":{"href":"https://api.github.com/repos/scala/scala/statuses/eec156250d22cdc97dbeb0c66263ff3da74b1268"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adriaanm"}}