{"action":"created","comment":{"url":"https://api.github.com/repos/scala/scala/pulls/comments/56924308","id":56924308,"diff_hunk":"@@ -1057,15 +1055,15 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper\n \n           if (context.implicitsEnabled && !pt.isError && !tree.isErrorTyped) {\n             // (14); the condition prevents chains of views\n-            debuglog(\"inferring view from \" + tree.tpe + \" to \" + pt)\n-            inferView(tree, tree.tpe, pt, reportAmbiguous = true) match {\n-              case EmptyTree =>\n+            inferView(tree, tree.tpe, pt) match {\n+              case EmptyTree => // didn't find a view -- fall through\n               case coercion  =>\n-                def msg = \"inferred view from \" + tree.tpe + \" to \" + pt + \" = \" + coercion + \":\" + coercion.tpe\n-                if (settings.logImplicitConv)\n-                  context.echo(tree.pos, msg)\n+                if (settings.debug || settings.logImplicitConv) {\n+                  val msg = s\"inferred view from ${tree.tpe} to $pt via $coercion: ${coercion.tpe}\"","path":"src/compiler/scala/tools/nsc/typechecker/Typers.scala","position":92,"original_position":92,"commit_id":"3ff165f9da738ec479071ccb4c9bc4ae29c636c6","original_commit_id":"504f00f3ff7594151635a7b8e061906e50ccc674","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":"I think this will create a throwaway string under `-Ydebug -XlogImplicitConv` (i.e. when `-Ylog:typer` is not enabled)","created_at":"2016-03-22T01:11:51Z","updated_at":"2016-03-22T01:11:51Z","html_url":"https://github.com/scala/scala/pull/4971#discussion_r56924308","pull_request_url":"https://api.github.com/repos/scala/scala/pulls/4971","_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/comments/56924308"},"html":{"href":"https://github.com/scala/scala/pull/4971#discussion_r56924308"},"pull_request":{"href":"https://api.github.com/repos/scala/scala/pulls/4971"}}},"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/4971","id":59584101,"html_url":"https://github.com/scala/scala/pull/4971","diff_url":"https://github.com/scala/scala/pull/4971.diff","patch_url":"https://github.com/scala/scala/pull/4971.patch","issue_url":"https://api.github.com/repos/scala/scala/issues/4971","number":4971,"state":"open","locked":false,"title":"Unify treatment of built-in functions and SAMs [ci: last-only]","user":{"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},"body":"SAM always on. Cleaned up while I was in the area (code & spec). Minimal spec for SAM conversion. \r\n\r\n@bvenners & @sjrd ask:\r\n - [x] interaction with implicit search\r\n\r\n@retronym suggests: \r\n - [x] serialization\r\n - [x] can a SAM become an un-SAM after typers? (--> Nested/local types) add tests\r\n - [x] also, exclude specialized types\r\n - (deferred) interaction with miniboxing\r\n\r\nfrom @lrytz:\r\n - (deferred) setting to disable sam conversion\r\n - [x] tests: by name\r\n - [x] junit test for bytecode emitted for various VC/Any/Unit combos\r\n - [x] check overloading spec, add test for ToString example to test/files/pos/sammy_overload.scala\r\n - [x] update comments in test/files/pos/t9449.scala\r\n - [x] more tests based on https://gist.github.com/lrytz/ec4da087dc65e421eb7d\r\n - [x] remove mention of `<static>` from spec\r\n - [x] remove comment from `+              functionType(vparams map (_ => AnyTpe), shapeType(body)) // TODO: should this be erased when retyping during erasure?`, replace with lrytz's clarification: \r\n  \r\n    > We don't even get here during erasure - overloading resolution happens during type checking. During erasure, the condition above (fun.symbol.isOverloaded) is false.\r\n\r\n  - [x] observed failure in overloading? \r\n```\r\nscala> trait ToString { def convert(x: Int): String }\r\ndefined trait ToString\r\n\r\nscala> object O {\r\n     |   def m(x: Int => String): Int = 0\r\n     |   def m(x: ToString): Int = 1\r\n     | }\r\ndefined object O\r\n\r\nscala> O.m(_.toString)\r\n<console>:14: error: missing parameter type for expanded function ((x$1: <error>) => x$1.toString)\r\n       O.m(_.toString)\r\n           ^\r\n```","created_at":"2016-02-17T01:38:16Z","updated_at":"2016-03-22T01:11:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6d9f4f3156cbb7159c10d2c058df690890a31f9","assignee":{"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},"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/51","html_url":"https://github.com/scala/scala/milestones/2.12.0-M4","labels_url":"https://api.github.com/repos/scala/scala/milestones/51/labels","id":1337791,"number":51,"title":"2.12.0-M4","description":"Leads: @sethtisue & @adriaanm\r\n\r\n  - [ ] traits: compile to interfaces with default methods (retronym, adriaanm) #5003\r\n  - [ ] SAM: enable by default, desugar function literals for non-`FunctionN` SAM types to `Function` trees and indylambda (instead of creating an anonymous class during typer) #4971\r\n  - [ ] classpath: enable `-YclasspathImpl:flat` by default (lrytz)\r\n  - [ ] RC1 release of scala-java8-compat: collections integration with Java 8 Streams (szeiger & ichoran)\r\n  - [X] traits: use INDY instead of static fields in implementation classes, which are no longer emitted (retronym) \r\n  - [X] optimizer: Copy propagation, remove unused values (closures!) and local variables  (lrytz)\r\n  - [X] optimizer: box-unbox elimination (lrytz)\r\n  - [X] remove genicode (ensure sbt/ide/... still works) (soc, lrytz)\r\n","creator":{"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},"open_issues":6,"closed_issues":117,"state":"open","created_at":"2015-10-05T09:46:45Z","updated_at":"2016-03-21T16:12:00Z","due_on":"2016-03-21T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scala/scala/pulls/4971/commits","review_comments_url":"https://api.github.com/repos/scala/scala/pulls/4971/comments","review_comment_url":"https://api.github.com/repos/scala/scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/scala/issues/4971/comments","statuses_url":"https://api.github.com/repos/scala/scala/statuses/3ff165f9da738ec479071ccb4c9bc4ae29c636c6","head":{"label":"adriaanm:genbcode-delambdafy","ref":"genbcode-delambdafy","sha":"3ff165f9da738ec479071ccb4c9bc4ae29c636c6","user":{"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},"repo":{"id":2890393,"name":"scala","full_name":"adriaanm/scala","owner":{"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},"private":false,"html_url":"https://github.com/adriaanm/scala","description":"The Scala programming language","fork":true,"url":"https://api.github.com/repos/adriaanm/scala","forks_url":"https://api.github.com/repos/adriaanm/scala/forks","keys_url":"https://api.github.com/repos/adriaanm/scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adriaanm/scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adriaanm/scala/teams","hooks_url":"https://api.github.com/repos/adriaanm/scala/hooks","issue_events_url":"https://api.github.com/repos/adriaanm/scala/issues/events{/number}","events_url":"https://api.github.com/repos/adriaanm/scala/events","assignees_url":"https://api.github.com/repos/adriaanm/scala/assignees{/user}","branches_url":"https://api.github.com/repos/adriaanm/scala/branches{/branch}","tags_url":"https://api.github.com/repos/adriaanm/scala/tags","blobs_url":"https://api.github.com/repos/adriaanm/scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adriaanm/scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adriaanm/scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/adriaanm/scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adriaanm/scala/statuses/{sha}","languages_url":"https://api.github.com/repos/adriaanm/scala/languages","stargazers_url":"https://api.github.com/repos/adriaanm/scala/stargazers","contributors_url":"https://api.github.com/repos/adriaanm/scala/contributors","subscribers_url":"https://api.github.com/repos/adriaanm/scala/subscribers","subscription_url":"https://api.github.com/repos/adriaanm/scala/subscription","commits_url":"https://api.github.com/repos/adriaanm/scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/adriaanm/scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/adriaanm/scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/adriaanm/scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/adriaanm/scala/contents/{+path}","compare_url":"https://api.github.com/repos/adriaanm/scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adriaanm/scala/merges","archive_url":"https://api.github.com/repos/adriaanm/scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adriaanm/scala/downloads","issues_url":"https://api.github.com/repos/adriaanm/scala/issues{/number}","pulls_url":"https://api.github.com/repos/adriaanm/scala/pulls{/number}","milestones_url":"https://api.github.com/repos/adriaanm/scala/milestones{/number}","notifications_url":"https://api.github.com/repos/adriaanm/scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adriaanm/scala/labels{/name}","releases_url":"https://api.github.com/repos/adriaanm/scala/releases{/id}","deployments_url":"https://api.github.com/repos/adriaanm/scala/deployments","created_at":"2011-12-01T10:52:13Z","updated_at":"2016-02-09T02:28:16Z","pushed_at":"2016-03-21T22:39:41Z","git_url":"git://github.com/adriaanm/scala.git","ssh_url":"git@github.com:adriaanm/scala.git","clone_url":"https://github.com/adriaanm/scala.git","svn_url":"https://github.com/adriaanm/scala","homepage":"http://www.scala-lang.org/","size":85769,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":4,"default_branch":"2.12.x"}},"base":{"label":"scala:2.12.x","ref":"2.12.x","sha":"1e148c88d860751c8f3a1c9b21a4505330a36c35","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-03-21T23:25:30Z","pushed_at":"2016-03-21T22:39:44Z","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":140954,"stargazers_count":5803,"watchers_count":5803,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1457,"mirror_url":null,"open_issues_count":32,"forks":1457,"open_issues":32,"watchers":5803,"default_branch":"2.12.x"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/scala/pulls/4971"},"html":{"href":"https://github.com/scala/scala/pull/4971"},"issue":{"href":"https://api.github.com/repos/scala/scala/issues/4971"},"comments":{"href":"https://api.github.com/repos/scala/scala/issues/4971/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/scala/pulls/4971/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/scala/pulls/4971/commits"},"statuses":{"href":"https://api.github.com/repos/scala/scala/statuses/3ff165f9da738ec479071ccb4c9bc4ae29c636c6"}}}}