{"action":"created","comment":{"url":"https://api.github.com/repos/adkozlov/scala-2018/pulls/comments/232063964","pull_request_review_id":173176445,"id":232063964,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjA2Mzk2NA==","diff_hunk":"@@ -0,0 +1,139 @@\n+package ru.hse\n+\n+import ru.hse.ExpParser.BoolLiteralContext\n+\n+sealed trait Literal {\n+  private def unsupportedOperation(operation: String) =\n+    throw new BinaryOperationException(\"An operation \" + operation + \" is not supported for given types\")\n+\n+  def +(literal: Literal): Literal = unsupportedOperation(\"+\")","path":"calculator/src/main/scala/ru/hse/Literal.scala","position":9,"original_position":9,"commit_id":"1b2d89a2a163c12cc046ebd69ec6e2bfe594dcbd","original_commit_id":"1b2d89a2a163c12cc046ebd69ec6e2bfe594dcbd","user":{"login":"oquechy","id":22048047,"node_id":"MDQ6VXNlcjIyMDQ4MDQ3","avatar_url":"https://avatars1.githubusercontent.com/u/22048047?v=4","gravatar_id":"","url":"https://api.github.com/users/oquechy","html_url":"https://github.com/oquechy","followers_url":"https://api.github.com/users/oquechy/followers","following_url":"https://api.github.com/users/oquechy/following{/other_user}","gists_url":"https://api.github.com/users/oquechy/gists{/gist_id}","starred_url":"https://api.github.com/users/oquechy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oquechy/subscriptions","organizations_url":"https://api.github.com/users/oquechy/orgs","repos_url":"https://api.github.com/users/oquechy/repos","events_url":"https://api.github.com/users/oquechy/events{/privacy}","received_events_url":"https://api.github.com/users/oquechy/received_events","type":"User","site_admin":false},"body":"Всё-таки не очень согласна. Мы ведь не умеем запрещать юзеру вводить что-то некорректное, типа true + 1. Получается, что в парсере должна создаваться констукция соответствующего вида. Но единственный корректный способ обработать такую ситуацию -- выдать ошибку. Хорошо бы при этом не писать порверку валидности аргументов при обработке каждого оператора, когда тип аргументов ещё не известен, а инкапсулировать её внутрь метода с наиболее общими типами параметров, то есть внутрь метода базового класса. С моей точки зрения, это вынесение метода в базовый класс как раз работает как избавление от копипасты. Почему бы и не сделать в Bool метод, бросающий исключение, если он служит для обработки некорректного ввода?","created_at":"2018-11-08T21:18:47Z","updated_at":"2018-11-08T21:18:48Z","html_url":"https://github.com/adkozlov/scala-2018/pull/14#discussion_r232063964","pull_request_url":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/adkozlov/scala-2018/pulls/comments/232063964"},"html":{"href":"https://github.com/adkozlov/scala-2018/pull/14#discussion_r232063964"},"pull_request":{"href":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14"}},"in_reply_to_id":231286439},"pull_request":{"url":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14","id":226324887,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MzI0ODg3","html_url":"https://github.com/adkozlov/scala-2018/pull/14","diff_url":"https://github.com/adkozlov/scala-2018/pull/14.diff","patch_url":"https://github.com/adkozlov/scala-2018/pull/14.patch","issue_url":"https://api.github.com/repos/adkozlov/scala-2018/issues/14","number":14,"state":"open","locked":false,"title":"HA1, Василенко Елизавета","user":{"login":"oquechy","id":22048047,"node_id":"MDQ6VXNlcjIyMDQ4MDQ3","avatar_url":"https://avatars1.githubusercontent.com/u/22048047?v=4","gravatar_id":"","url":"https://api.github.com/users/oquechy","html_url":"https://github.com/oquechy","followers_url":"https://api.github.com/users/oquechy/followers","following_url":"https://api.github.com/users/oquechy/following{/other_user}","gists_url":"https://api.github.com/users/oquechy/gists{/gist_id}","starred_url":"https://api.github.com/users/oquechy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oquechy/subscriptions","organizations_url":"https://api.github.com/users/oquechy/orgs","repos_url":"https://api.github.com/users/oquechy/repos","events_url":"https://api.github.com/users/oquechy/events{/privacy}","received_events_url":"https://api.github.com/users/oquechy/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-27T21:21:42Z","updated_at":"2018-11-08T21:18:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"689e5507cc5bd71f48dc64b135a2e95f6245222d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14/commits","review_comments_url":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14/comments","review_comment_url":"https://api.github.com/repos/adkozlov/scala-2018/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adkozlov/scala-2018/issues/14/comments","statuses_url":"https://api.github.com/repos/adkozlov/scala-2018/statuses/1b2d89a2a163c12cc046ebd69ec6e2bfe594dcbd","head":{"label":"oquechy:01-calculator","ref":"01-calculator","sha":"1b2d89a2a163c12cc046ebd69ec6e2bfe594dcbd","user":{"login":"oquechy","id":22048047,"node_id":"MDQ6VXNlcjIyMDQ4MDQ3","avatar_url":"https://avatars1.githubusercontent.com/u/22048047?v=4","gravatar_id":"","url":"https://api.github.com/users/oquechy","html_url":"https://github.com/oquechy","followers_url":"https://api.github.com/users/oquechy/followers","following_url":"https://api.github.com/users/oquechy/following{/other_user}","gists_url":"https://api.github.com/users/oquechy/gists{/gist_id}","starred_url":"https://api.github.com/users/oquechy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oquechy/subscriptions","organizations_url":"https://api.github.com/users/oquechy/orgs","repos_url":"https://api.github.com/users/oquechy/repos","events_url":"https://api.github.com/users/oquechy/events{/privacy}","received_events_url":"https://api.github.com/users/oquechy/received_events","type":"User","site_admin":false},"repo":{"id":152460951,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI0NjA5NTE=","name":"scala-2018","full_name":"oquechy/scala-2018","private":false,"owner":{"login":"oquechy","id":22048047,"node_id":"MDQ6VXNlcjIyMDQ4MDQ3","avatar_url":"https://avatars1.githubusercontent.com/u/22048047?v=4","gravatar_id":"","url":"https://api.github.com/users/oquechy","html_url":"https://github.com/oquechy","followers_url":"https://api.github.com/users/oquechy/followers","following_url":"https://api.github.com/users/oquechy/following{/other_user}","gists_url":"https://api.github.com/users/oquechy/gists{/gist_id}","starred_url":"https://api.github.com/users/oquechy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oquechy/subscriptions","organizations_url":"https://api.github.com/users/oquechy/orgs","repos_url":"https://api.github.com/users/oquechy/repos","events_url":"https://api.github.com/users/oquechy/events{/privacy}","received_events_url":"https://api.github.com/users/oquechy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/oquechy/scala-2018","description":"Scala course at HSE/ITMO, Fall'18.","fork":true,"url":"https://api.github.com/repos/oquechy/scala-2018","forks_url":"https://api.github.com/repos/oquechy/scala-2018/forks","keys_url":"https://api.github.com/repos/oquechy/scala-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oquechy/scala-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oquechy/scala-2018/teams","hooks_url":"https://api.github.com/repos/oquechy/scala-2018/hooks","issue_events_url":"https://api.github.com/repos/oquechy/scala-2018/issues/events{/number}","events_url":"https://api.github.com/repos/oquechy/scala-2018/events","assignees_url":"https://api.github.com/repos/oquechy/scala-2018/assignees{/user}","branches_url":"https://api.github.com/repos/oquechy/scala-2018/branches{/branch}","tags_url":"https://api.github.com/repos/oquechy/scala-2018/tags","blobs_url":"https://api.github.com/repos/oquechy/scala-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oquechy/scala-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oquechy/scala-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/oquechy/scala-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oquechy/scala-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/oquechy/scala-2018/languages","stargazers_url":"https://api.github.com/repos/oquechy/scala-2018/stargazers","contributors_url":"https://api.github.com/repos/oquechy/scala-2018/contributors","subscribers_url":"https://api.github.com/repos/oquechy/scala-2018/subscribers","subscription_url":"https://api.github.com/repos/oquechy/scala-2018/subscription","commits_url":"https://api.github.com/repos/oquechy/scala-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/oquechy/scala-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/oquechy/scala-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/oquechy/scala-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/oquechy/scala-2018/contents/{+path}","compare_url":"https://api.github.com/repos/oquechy/scala-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oquechy/scala-2018/merges","archive_url":"https://api.github.com/repos/oquechy/scala-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oquechy/scala-2018/downloads","issues_url":"https://api.github.com/repos/oquechy/scala-2018/issues{/number}","pulls_url":"https://api.github.com/repos/oquechy/scala-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/oquechy/scala-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/oquechy/scala-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oquechy/scala-2018/labels{/name}","releases_url":"https://api.github.com/repos/oquechy/scala-2018/releases{/id}","deployments_url":"https://api.github.com/repos/oquechy/scala-2018/deployments","created_at":"2018-10-10T17:13:23Z","updated_at":"2018-10-27T14:19:47Z","pushed_at":"2018-10-27T21:19:38Z","git_url":"git://github.com/oquechy/scala-2018.git","ssh_url":"git@github.com:oquechy/scala-2018.git","clone_url":"https://github.com/oquechy/scala-2018.git","svn_url":"https://github.com/oquechy/scala-2018","homepage":null,"size":19,"stargazers_count":1,"watchers_count":1,"language":"Scala","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":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"adkozlov:01-calculator","ref":"01-calculator","sha":"f14b9e00643fd5bb2ff757ade2e1d1a523fff120","user":{"login":"adkozlov","id":1233785,"node_id":"MDQ6VXNlcjEyMzM3ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1233785?v=4","gravatar_id":"","url":"https://api.github.com/users/adkozlov","html_url":"https://github.com/adkozlov","followers_url":"https://api.github.com/users/adkozlov/followers","following_url":"https://api.github.com/users/adkozlov/following{/other_user}","gists_url":"https://api.github.com/users/adkozlov/gists{/gist_id}","starred_url":"https://api.github.com/users/adkozlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adkozlov/subscriptions","organizations_url":"https://api.github.com/users/adkozlov/orgs","repos_url":"https://api.github.com/users/adkozlov/repos","events_url":"https://api.github.com/users/adkozlov/events{/privacy}","received_events_url":"https://api.github.com/users/adkozlov/received_events","type":"User","site_admin":false},"repo":{"id":152305721,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIzMDU3MjE=","name":"scala-2018","full_name":"adkozlov/scala-2018","private":false,"owner":{"login":"adkozlov","id":1233785,"node_id":"MDQ6VXNlcjEyMzM3ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1233785?v=4","gravatar_id":"","url":"https://api.github.com/users/adkozlov","html_url":"https://github.com/adkozlov","followers_url":"https://api.github.com/users/adkozlov/followers","following_url":"https://api.github.com/users/adkozlov/following{/other_user}","gists_url":"https://api.github.com/users/adkozlov/gists{/gist_id}","starred_url":"https://api.github.com/users/adkozlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adkozlov/subscriptions","organizations_url":"https://api.github.com/users/adkozlov/orgs","repos_url":"https://api.github.com/users/adkozlov/repos","events_url":"https://api.github.com/users/adkozlov/events{/privacy}","received_events_url":"https://api.github.com/users/adkozlov/received_events","type":"User","site_admin":false},"html_url":"https://github.com/adkozlov/scala-2018","description":"Scala course at HSE/ITMO, Fall'18.","fork":false,"url":"https://api.github.com/repos/adkozlov/scala-2018","forks_url":"https://api.github.com/repos/adkozlov/scala-2018/forks","keys_url":"https://api.github.com/repos/adkozlov/scala-2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adkozlov/scala-2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adkozlov/scala-2018/teams","hooks_url":"https://api.github.com/repos/adkozlov/scala-2018/hooks","issue_events_url":"https://api.github.com/repos/adkozlov/scala-2018/issues/events{/number}","events_url":"https://api.github.com/repos/adkozlov/scala-2018/events","assignees_url":"https://api.github.com/repos/adkozlov/scala-2018/assignees{/user}","branches_url":"https://api.github.com/repos/adkozlov/scala-2018/branches{/branch}","tags_url":"https://api.github.com/repos/adkozlov/scala-2018/tags","blobs_url":"https://api.github.com/repos/adkozlov/scala-2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adkozlov/scala-2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adkozlov/scala-2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/adkozlov/scala-2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adkozlov/scala-2018/statuses/{sha}","languages_url":"https://api.github.com/repos/adkozlov/scala-2018/languages","stargazers_url":"https://api.github.com/repos/adkozlov/scala-2018/stargazers","contributors_url":"https://api.github.com/repos/adkozlov/scala-2018/contributors","subscribers_url":"https://api.github.com/repos/adkozlov/scala-2018/subscribers","subscription_url":"https://api.github.com/repos/adkozlov/scala-2018/subscription","commits_url":"https://api.github.com/repos/adkozlov/scala-2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/adkozlov/scala-2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/adkozlov/scala-2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/adkozlov/scala-2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/adkozlov/scala-2018/contents/{+path}","compare_url":"https://api.github.com/repos/adkozlov/scala-2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adkozlov/scala-2018/merges","archive_url":"https://api.github.com/repos/adkozlov/scala-2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adkozlov/scala-2018/downloads","issues_url":"https://api.github.com/repos/adkozlov/scala-2018/issues{/number}","pulls_url":"https://api.github.com/repos/adkozlov/scala-2018/pulls{/number}","milestones_url":"https://api.github.com/repos/adkozlov/scala-2018/milestones{/number}","notifications_url":"https://api.github.com/repos/adkozlov/scala-2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adkozlov/scala-2018/labels{/name}","releases_url":"https://api.github.com/repos/adkozlov/scala-2018/releases{/id}","deployments_url":"https://api.github.com/repos/adkozlov/scala-2018/deployments","created_at":"2018-10-09T19:01:54Z","updated_at":"2018-11-07T09:39:23Z","pushed_at":"2018-11-07T09:39:22Z","git_url":"git://github.com/adkozlov/scala-2018.git","ssh_url":"git@github.com:adkozlov/scala-2018.git","clone_url":"https://github.com/adkozlov/scala-2018.git","svn_url":"https://github.com/adkozlov/scala-2018","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":34,"open_issues":33,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14"},"html":{"href":"https://github.com/adkozlov/scala-2018/pull/14"},"issue":{"href":"https://api.github.com/repos/adkozlov/scala-2018/issues/14"},"comments":{"href":"https://api.github.com/repos/adkozlov/scala-2018/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/adkozlov/scala-2018/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adkozlov/scala-2018/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/adkozlov/scala-2018/statuses/1b2d89a2a163c12cc046ebd69ec6e2bfe594dcbd"}},"author_association":"NONE"}}
{"actor":{"display_login":"oquechy"}}