GitHub PullRequestReviewCommentEvent at 2014-07-18 07:09:53
Repository: scala-records
Actor: hubertp
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/scala-records/scala-records/pulls/comments/15098885","id":15098885,"diff_hunk":"@@ -56,33 +56,57 @@ object RecordConversions {\n       }\n     }\n \n-    def convertRecordMaterializer(fromType: Type, toType: Type): Tree = {\n-      val toSym = toType.typeSymbol\n-\n-      if (!toSym.asClass.isCaseClass) {\n-        c.abort(NoPosition,\n-          s\"Records can only be converted to case classes; $toType is not a case class.\")\n+    def convertRecordMaterializer(fromType: Type, toType: Type, path: List[String] = Nil): Tree =\n+      convertRecordMaterializer(fromType, toType, toType, path)\n+\n+    def convertRecordMaterializer(\n+      fromType: Type,\n+      toType: Type,\n+      originalType: Type,\n+      path: List[String]): Tree = {\n+\n+      def isCaseClass(tpe: Type) =\n+        toType.typeSymbol.asClass.isCaseClass\n+\n+      // check if the expected type is a case class\n+      val prefix = if (path == Nil) \"\" else path.mkString(\"\", \".\", \".\")","path":"core/src/main/scala/records/RecordConversions.scala","position":23,"original_position":23,"commit_id":"1d13ff36ab413cc3174efaa8810f0072cb0571fb","original_commit_id":"1d13ff36ab413cc3174efaa8810f0072cb0571fb","user":{"login":"hubertp","id":292128,"avatar_url":"https://avatars.githubusercontent.com/u/292128?","gravatar_id":"e0dec64f93778e5c689c3873078a406f","url":"https://api.github.com/users/hubertp","html_url":"https://github.com/hubertp","followers_url":"https://api.github.com/users/hubertp/followers","following_url":"https://api.github.com/users/hubertp/following{/other_user}","gists_url":"https://api.github.com/users/hubertp/gists{/gist_id}","starred_url":"https://api.github.com/users/hubertp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubertp/subscriptions","organizations_url":"https://api.github.com/users/hubertp/orgs","repos_url":"https://api.github.com/users/hubertp/repos","events_url":"https://api.github.com/users/hubertp/events{/privacy}","received_events_url":"https://api.github.com/users/hubertp/received_events","type":"User","site_admin":false},"body":"prefix should be a def","created_at":"2014-07-18T07:09:53Z","updated_at":"2014-07-18T07:09:53Z","html_url":"https://github.com/scala-records/scala-records/pull/70#discussion_r15098885","pull_request_url":"https://api.github.com/repos/scala-records/scala-records/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/scala-records/scala-records/pulls/comments/15098885"},"html":{"href":"https://github.com/scala-records/scala-records/pull/70#discussion_r15098885"},"pull_request":{"href":"https://api.github.com/repos/scala-records/scala-records/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/scala-records/scala-records/pulls/70","id":18544410,"html_url":"https://github.com/scala-records/scala-records/pull/70","diff_url":"https://github.com/scala-records/scala-records/pull/70.diff","patch_url":"https://github.com/scala-records/scala-records/pull/70.patch","issue_url":"https://api.github.com/repos/scala-records/scala-records/issues/70","number":70,"state":"open","title":"Nested case class conversion with nice error messages.","user":{"login":"vjovanov","id":352820,"avatar_url":"https://avatars.githubusercontent.com/u/352820?","gravatar_id":"3dcbfe479e16ee31dbae3fc84f3c681c","url":"https://api.github.com/users/vjovanov","html_url":"https://github.com/vjovanov","followers_url":"https://api.github.com/users/vjovanov/followers","following_url":"https://api.github.com/users/vjovanov/following{/other_user}","gists_url":"https://api.github.com/users/vjovanov/gists{/gist_id}","starred_url":"https://api.github.com/users/vjovanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjovanov/subscriptions","organizations_url":"https://api.github.com/users/vjovanov/orgs","repos_url":"https://api.github.com/users/vjovanov/repos","events_url":"https://api.github.com/users/vjovanov/events{/privacy}","received_events_url":"https://api.github.com/users/vjovanov/received_events","type":"User","site_admin":false},"body":"Fixes #58\r\nReview by @gzm0 @hubertp\r\n","created_at":"2014-07-17T18:08:00Z","updated_at":"2014-07-18T07:09:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a81905eaac388f61674e40fbf4ce1f0dab26794","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-records/scala-records/pulls/70/commits","review_comments_url":"https://api.github.com/repos/scala-records/scala-records/pulls/70/comments","review_comment_url":"https://api.github.com/repos/scala-records/scala-records/pulls/comments/{number}","comments_url":"https://api.github.com/repos/scala-records/scala-records/issues/70/comments","statuses_url":"https://api.github.com/repos/scala-records/scala-records/statuses/1d13ff36ab413cc3174efaa8810f0072cb0571fb","head":{"label":"vjovanov:nested-record-conversions","ref":"nested-record-conversions","sha":"1d13ff36ab413cc3174efaa8810f0072cb0571fb","user":{"login":"vjovanov","id":352820,"avatar_url":"https://avatars.githubusercontent.com/u/352820?","gravatar_id":"3dcbfe479e16ee31dbae3fc84f3c681c","url":"https://api.github.com/users/vjovanov","html_url":"https://github.com/vjovanov","followers_url":"https://api.github.com/users/vjovanov/followers","following_url":"https://api.github.com/users/vjovanov/following{/other_user}","gists_url":"https://api.github.com/users/vjovanov/gists{/gist_id}","starred_url":"https://api.github.com/users/vjovanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjovanov/subscriptions","organizations_url":"https://api.github.com/users/vjovanov/orgs","repos_url":"https://api.github.com/users/vjovanov/repos","events_url":"https://api.github.com/users/vjovanov/events{/privacy}","received_events_url":"https://api.github.com/users/vjovanov/received_events","type":"User","site_admin":false},"repo":{"id":21949052,"name":"scala-records","full_name":"vjovanov/scala-records","owner":{"login":"vjovanov","id":352820,"avatar_url":"https://avatars.githubusercontent.com/u/352820?","gravatar_id":"3dcbfe479e16ee31dbae3fc84f3c681c","url":"https://api.github.com/users/vjovanov","html_url":"https://github.com/vjovanov","followers_url":"https://api.github.com/users/vjovanov/followers","following_url":"https://api.github.com/users/vjovanov/following{/other_user}","gists_url":"https://api.github.com/users/vjovanov/gists{/gist_id}","starred_url":"https://api.github.com/users/vjovanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjovanov/subscriptions","organizations_url":"https://api.github.com/users/vjovanov/orgs","repos_url":"https://api.github.com/users/vjovanov/repos","events_url":"https://api.github.com/users/vjovanov/events{/privacy}","received_events_url":"https://api.github.com/users/vjovanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vjovanov/scala-records","description":"Labeled records for Scala based on structural refinement types and macros.","fork":true,"url":"https://api.github.com/repos/vjovanov/scala-records","forks_url":"https://api.github.com/repos/vjovanov/scala-records/forks","keys_url":"https://api.github.com/repos/vjovanov/scala-records/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vjovanov/scala-records/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vjovanov/scala-records/teams","hooks_url":"https://api.github.com/repos/vjovanov/scala-records/hooks","issue_events_url":"https://api.github.com/repos/vjovanov/scala-records/issues/events{/number}","events_url":"https://api.github.com/repos/vjovanov/scala-records/events","assignees_url":"https://api.github.com/repos/vjovanov/scala-records/assignees{/user}","branches_url":"https://api.github.com/repos/vjovanov/scala-records/branches{/branch}","tags_url":"https://api.github.com/repos/vjovanov/scala-records/tags","blobs_url":"https://api.github.com/repos/vjovanov/scala-records/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vjovanov/scala-records/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vjovanov/scala-records/git/refs{/sha}","trees_url":"https://api.github.com/repos/vjovanov/scala-records/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vjovanov/scala-records/statuses/{sha}","languages_url":"https://api.github.com/repos/vjovanov/scala-records/languages","stargazers_url":"https://api.github.com/repos/vjovanov/scala-records/stargazers","contributors_url":"https://api.github.com/repos/vjovanov/scala-records/contributors","subscribers_url":"https://api.github.com/repos/vjovanov/scala-records/subscribers","subscription_url":"https://api.github.com/repos/vjovanov/scala-records/subscription","commits_url":"https://api.github.com/repos/vjovanov/scala-records/commits{/sha}","git_commits_url":"https://api.github.com/repos/vjovanov/scala-records/git/commits{/sha}","comments_url":"https://api.github.com/repos/vjovanov/scala-records/comments{/number}","issue_comment_url":"https://api.github.com/repos/vjovanov/scala-records/issues/comments/{number}","contents_url":"https://api.github.com/repos/vjovanov/scala-records/contents/{+path}","compare_url":"https://api.github.com/repos/vjovanov/scala-records/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vjovanov/scala-records/merges","archive_url":"https://api.github.com/repos/vjovanov/scala-records/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vjovanov/scala-records/downloads","issues_url":"https://api.github.com/repos/vjovanov/scala-records/issues{/number}","pulls_url":"https://api.github.com/repos/vjovanov/scala-records/pulls{/number}","milestones_url":"https://api.github.com/repos/vjovanov/scala-records/milestones{/number}","notifications_url":"https://api.github.com/repos/vjovanov/scala-records/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vjovanov/scala-records/labels{/name}","releases_url":"https://api.github.com/repos/vjovanov/scala-records/releases{/id}","created_at":"2014-07-17T16:20:50Z","updated_at":"2014-07-17T18:02:21Z","pushed_at":"2014-07-17T19:34:53Z","git_url":"git://github.com/vjovanov/scala-records.git","ssh_url":"git@github.com:vjovanov/scala-records.git","clone_url":"https://github.com/vjovanov/scala-records.git","svn_url":"https://github.com/vjovanov/scala-records","homepage":"","size":303,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scala-records:master","ref":"master","sha":"200f138cd639ce97ca8aae7ee237dc13cfdc55f2","user":{"login":"scala-records","id":8191619,"avatar_url":"https://avatars.githubusercontent.com/u/8191619?","gravatar_id":null,"url":"https://api.github.com/users/scala-records","html_url":"https://github.com/scala-records","followers_url":"https://api.github.com/users/scala-records/followers","following_url":"https://api.github.com/users/scala-records/following{/other_user}","gists_url":"https://api.github.com/users/scala-records/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-records/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-records/subscriptions","organizations_url":"https://api.github.com/users/scala-records/orgs","repos_url":"https://api.github.com/users/scala-records/repos","events_url":"https://api.github.com/users/scala-records/events{/privacy}","received_events_url":"https://api.github.com/users/scala-records/received_events","type":"Organization","site_admin":false},"repo":{"id":20918597,"name":"scala-records","full_name":"scala-records/scala-records","owner":{"login":"scala-records","id":8191619,"avatar_url":"https://avatars.githubusercontent.com/u/8191619?","gravatar_id":null,"url":"https://api.github.com/users/scala-records","html_url":"https://github.com/scala-records","followers_url":"https://api.github.com/users/scala-records/followers","following_url":"https://api.github.com/users/scala-records/following{/other_user}","gists_url":"https://api.github.com/users/scala-records/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-records/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-records/subscriptions","organizations_url":"https://api.github.com/users/scala-records/orgs","repos_url":"https://api.github.com/users/scala-records/repos","events_url":"https://api.github.com/users/scala-records/events{/privacy}","received_events_url":"https://api.github.com/users/scala-records/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-records/scala-records","description":"Labeled records for Scala based on structural refinement types and macros.","fork":false,"url":"https://api.github.com/repos/scala-records/scala-records","forks_url":"https://api.github.com/repos/scala-records/scala-records/forks","keys_url":"https://api.github.com/repos/scala-records/scala-records/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-records/scala-records/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-records/scala-records/teams","hooks_url":"https://api.github.com/repos/scala-records/scala-records/hooks","issue_events_url":"https://api.github.com/repos/scala-records/scala-records/issues/events{/number}","events_url":"https://api.github.com/repos/scala-records/scala-records/events","assignees_url":"https://api.github.com/repos/scala-records/scala-records/assignees{/user}","branches_url":"https://api.github.com/repos/scala-records/scala-records/branches{/branch}","tags_url":"https://api.github.com/repos/scala-records/scala-records/tags","blobs_url":"https://api.github.com/repos/scala-records/scala-records/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-records/scala-records/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-records/scala-records/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-records/scala-records/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-records/scala-records/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-records/scala-records/languages","stargazers_url":"https://api.github.com/repos/scala-records/scala-records/stargazers","contributors_url":"https://api.github.com/repos/scala-records/scala-records/contributors","subscribers_url":"https://api.github.com/repos/scala-records/scala-records/subscribers","subscription_url":"https://api.github.com/repos/scala-records/scala-records/subscription","commits_url":"https://api.github.com/repos/scala-records/scala-records/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-records/scala-records/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-records/scala-records/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-records/scala-records/issues/comments/{number}","contents_url":"https://api.github.com/repos/scala-records/scala-records/contents/{+path}","compare_url":"https://api.github.com/repos/scala-records/scala-records/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-records/scala-records/merges","archive_url":"https://api.github.com/repos/scala-records/scala-records/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-records/scala-records/downloads","issues_url":"https://api.github.com/repos/scala-records/scala-records/issues{/number}","pulls_url":"https://api.github.com/repos/scala-records/scala-records/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-records/scala-records/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-records/scala-records/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-records/scala-records/labels{/name}","releases_url":"https://api.github.com/repos/scala-records/scala-records/releases{/id}","created_at":"2014-06-17T09:59:57Z","updated_at":"2014-07-17T14:07:02Z","pushed_at":"2014-07-18T07:05:36Z","git_url":"git://github.com/scala-records/scala-records.git","ssh_url":"git@github.com:scala-records/scala-records.git","clone_url":"https://github.com/scala-records/scala-records.git","svn_url":"https://github.com/scala-records/scala-records","homepage":"","size":1569,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":4,"mirror_url":null,"open_issues_count":14,"forks":4,"open_issues":14,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-records/scala-records/pulls/70"},"html":{"href":"https://github.com/scala-records/scala-records/pull/70"},"issue":{"href":"https://api.github.com/repos/scala-records/scala-records/issues/70"},"comments":{"href":"https://api.github.com/repos/scala-records/scala-records/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-records/scala-records/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-records/scala-records/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/scala-records/scala-records/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/scala-records/scala-records/statuses/1d13ff36ab413cc3174efaa8810f0072cb0571fb"}}}}