{"action":"created","comment":{"url":"https://api.github.com/repos/dlang/dmd/pulls/comments/66423357","id":66423357,"diff_hunk":"@@ -11821,6 +11842,26 @@ extern (C++) final class CommaExp : BinExp\n     {\n         v.visit(this);\n     }\n+\n+    /**\n+     * If the argument is a CommaExp, set a flag to prevent deprecation messages\n+     *\n+     * It's impossible to know from CommaExp.semantic if the result will\n+     * be used, hence when there is a result (type != void), a deprecation\n+     * message is always emitted.\n+     * However, some construct can produce a result but won't use it\n+     * (ExpStatement and for loop increment).  Those should call this function\n+     * to prevent unwanted deprecations to be emitted.\n+     *\n+     * Params:\n+     *   exp = An expression that discards its result.\n+     *         If the argument is null or not a CommaExp, nothing happens.\n+     */\n+    static void allow(Expression exp)\n+    {\n+        if (exp && exp.op == TOK.TOKcomma)","path":"src/expression.d","position":67,"original_position":67,"commit_id":"9082f74b63122640efb518aa08f1ad004b1dcb2c","original_commit_id":"9082f74b63122640efb518aa08f1ad004b1dcb2c","user":{"login":"ZombineDev","id":3475150,"avatar_url":"https://avatars.githubusercontent.com/u/3475150?v=3","gravatar_id":"","url":"https://api.github.com/users/ZombineDev","html_url":"https://github.com/ZombineDev","followers_url":"https://api.github.com/users/ZombineDev/followers","following_url":"https://api.github.com/users/ZombineDev/following{/other_user}","gists_url":"https://api.github.com/users/ZombineDev/gists{/gist_id}","starred_url":"https://api.github.com/users/ZombineDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZombineDev/subscriptions","organizations_url":"https://api.github.com/users/ZombineDev/orgs","repos_url":"https://api.github.com/users/ZombineDev/repos","events_url":"https://api.github.com/users/ZombineDev/events{/privacy}","received_events_url":"https://api.github.com/users/ZombineDev/received_events","type":"User","site_admin":false},"body":"I thought that even though it accepts `Expression` the expectation is that the expression is always of type `CommaExp` (at runtime) and it would be logical error if something else was passed as an argument.","created_at":"2016-06-09T11:21:16Z","updated_at":"2016-06-09T11:21:16Z","html_url":"https://github.com/dlang/dmd/pull/5737#discussion_r66423357","pull_request_url":"https://api.github.com/repos/dlang/dmd/pulls/5737","_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments/66423357"},"html":{"href":"https://github.com/dlang/dmd/pull/5737#discussion_r66423357"},"pull_request":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5737"}}},"pull_request":{"url":"https://api.github.com/repos/dlang/dmd/pulls/5737","id":69242075,"html_url":"https://github.com/dlang/dmd/pull/5737","diff_url":"https://github.com/dlang/dmd/pull/5737.diff","patch_url":"https://github.com/dlang/dmd/pull/5737.patch","issue_url":"https://api.github.com/repos/dlang/dmd/issues/5737","number":5737,"state":"open","locked":false,"title":"Fix Issue 2659 - Deprecate using the return of a comma expression","user":{"login":"Geod24","id":2180215,"avatar_url":"https://avatars.githubusercontent.com/u/2180215?v=3","gravatar_id":"","url":"https://api.github.com/users/Geod24","html_url":"https://github.com/Geod24","followers_url":"https://api.github.com/users/Geod24/followers","following_url":"https://api.github.com/users/Geod24/following{/other_user}","gists_url":"https://api.github.com/users/Geod24/gists{/gist_id}","starred_url":"https://api.github.com/users/Geod24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Geod24/subscriptions","organizations_url":"https://api.github.com/users/Geod24/orgs","repos_url":"https://api.github.com/users/Geod24/repos","events_url":"https://api.github.com/users/Geod24/events{/privacy}","received_events_url":"https://api.github.com/users/Geod24/received_events","type":"User","site_admin":false},"body":"The comma operator is a constant source of confusion / bugs.\r\nIn all use case, code using comma operator can be rewritten without hurting readability. The exception is the increment part of `for` loops, where it is pretty handy.\r\nThis P.R. introduce a deprecation message for every usage that isn't in a for loop increment.\r\n\r\nExample of fixes needed outside of DMD:\r\n- https://github.com/dlang/druntime/pull/1561\r\n- Bug introduced by CommaExp: https://github.com/dlang/druntime/pull/1562\r\n- https://github.com/dlang/dub/pull/837\r\n- https://github.com/rejectedsoftware/vibe.d/pull/1487\r\n\r\nNote:\r\nThere were some `CommaExp` in the test that I had to silence using `-d`.\r\nThe underlying reason is that deprecations message shouldn't require those tests to change (and the change was pretty big since I would have had to update all line numbers of error messages...).\r\n\r\nUltimately, in `for` statement, I think we should recommend using something along the line of `{ a.popFront; b.popFront; }` instead, but it shouldn't introduce any performance hit, which is not currently the case.\r\n\r\nMandatory ping to @andralex / @WalterBright as this is a language change.","created_at":"2016-05-07T13:09:11Z","updated_at":"2016-06-09T11:21:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2860d038af21e852d683da74d11cf0e8ec6ef76d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dlang/dmd/pulls/5737/commits","review_comments_url":"https://api.github.com/repos/dlang/dmd/pulls/5737/comments","review_comment_url":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/dmd/issues/5737/comments","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/9082f74b63122640efb518aa08f1ad004b1dcb2c","head":{"label":"mathias-lang-sociomantic:coma-operator-must-die","ref":"coma-operator-must-die","sha":"9082f74b63122640efb518aa08f1ad004b1dcb2c","user":{"login":"mathias-lang-sociomantic","id":11289420,"avatar_url":"https://avatars.githubusercontent.com/u/11289420?v=3","gravatar_id":"","url":"https://api.github.com/users/mathias-lang-sociomantic","html_url":"https://github.com/mathias-lang-sociomantic","followers_url":"https://api.github.com/users/mathias-lang-sociomantic/followers","following_url":"https://api.github.com/users/mathias-lang-sociomantic/following{/other_user}","gists_url":"https://api.github.com/users/mathias-lang-sociomantic/gists{/gist_id}","starred_url":"https://api.github.com/users/mathias-lang-sociomantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathias-lang-sociomantic/subscriptions","organizations_url":"https://api.github.com/users/mathias-lang-sociomantic/orgs","repos_url":"https://api.github.com/users/mathias-lang-sociomantic/repos","events_url":"https://api.github.com/users/mathias-lang-sociomantic/events{/privacy}","received_events_url":"https://api.github.com/users/mathias-lang-sociomantic/received_events","type":"User","site_admin":false},"repo":{"id":34468086,"name":"dmd-dlang","full_name":"mathias-lang-sociomantic/dmd-dlang","owner":{"login":"mathias-lang-sociomantic","id":11289420,"avatar_url":"https://avatars.githubusercontent.com/u/11289420?v=3","gravatar_id":"","url":"https://api.github.com/users/mathias-lang-sociomantic","html_url":"https://github.com/mathias-lang-sociomantic","followers_url":"https://api.github.com/users/mathias-lang-sociomantic/followers","following_url":"https://api.github.com/users/mathias-lang-sociomantic/following{/other_user}","gists_url":"https://api.github.com/users/mathias-lang-sociomantic/gists{/gist_id}","starred_url":"https://api.github.com/users/mathias-lang-sociomantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathias-lang-sociomantic/subscriptions","organizations_url":"https://api.github.com/users/mathias-lang-sociomantic/orgs","repos_url":"https://api.github.com/users/mathias-lang-sociomantic/repos","events_url":"https://api.github.com/users/mathias-lang-sociomantic/events{/privacy}","received_events_url":"https://api.github.com/users/mathias-lang-sociomantic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mathias-lang-sociomantic/dmd-dlang","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang","forks_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/forks","keys_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/teams","hooks_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/hooks","issue_events_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/issues/events{/number}","events_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/events","assignees_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/assignees{/user}","branches_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/branches{/branch}","tags_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/tags","blobs_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/statuses/{sha}","languages_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/languages","stargazers_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/stargazers","contributors_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/contributors","subscribers_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/subscribers","subscription_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/subscription","commits_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/contents/{+path}","compare_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/merges","archive_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/downloads","issues_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/issues{/number}","pulls_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/pulls{/number}","milestones_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/milestones{/number}","notifications_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/labels{/name}","releases_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/releases{/id}","deployments_url":"https://api.github.com/repos/mathias-lang-sociomantic/dmd-dlang/deployments","created_at":"2015-04-23T16:29:10Z","updated_at":"2016-01-11T20:08:26Z","pushed_at":"2016-06-09T01:19:25Z","git_url":"git://github.com/mathias-lang-sociomantic/dmd-dlang.git","ssh_url":"git@github.com:mathias-lang-sociomantic/dmd-dlang.git","clone_url":"https://github.com/mathias-lang-sociomantic/dmd-dlang.git","svn_url":"https://github.com/mathias-lang-sociomantic/dmd-dlang","homepage":"dlang.org","size":66435,"stargazers_count":0,"watchers_count":0,"language":"D","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":"master"}},"base":{"label":"dlang:master","ref":"master","sha":"9da9c30703e4e5d4f87289f89c9e3d945bf0ff49","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"dlang/dmd","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/dlang/dmd","forks_url":"https://api.github.com/repos/dlang/dmd/forks","keys_url":"https://api.github.com/repos/dlang/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/dmd/teams","hooks_url":"https://api.github.com/repos/dlang/dmd/hooks","issue_events_url":"https://api.github.com/repos/dlang/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/dmd/events","assignees_url":"https://api.github.com/repos/dlang/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/dmd/tags","blobs_url":"https://api.github.com/repos/dlang/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/dmd/languages","stargazers_url":"https://api.github.com/repos/dlang/dmd/stargazers","contributors_url":"https://api.github.com/repos/dlang/dmd/contributors","subscribers_url":"https://api.github.com/repos/dlang/dmd/subscribers","subscription_url":"https://api.github.com/repos/dlang/dmd/subscription","commits_url":"https://api.github.com/repos/dlang/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/dmd/merges","archive_url":"https://api.github.com/repos/dlang/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/dmd/downloads","issues_url":"https://api.github.com/repos/dlang/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/dmd/labels{/name}","releases_url":"https://api.github.com/repos/dlang/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/dmd/deployments","created_at":"2011-01-15T06:53:53Z","updated_at":"2016-06-07T13:18:11Z","pushed_at":"2016-06-09T11:00:58Z","git_url":"git://github.com/dlang/dmd.git","ssh_url":"git@github.com:dlang/dmd.git","clone_url":"https://github.com/dlang/dmd.git","svn_url":"https://github.com/dlang/dmd","homepage":"dlang.org","size":89314,"stargazers_count":1236,"watchers_count":1236,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":365,"mirror_url":null,"open_issues_count":149,"forks":365,"open_issues":149,"watchers":1236,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5737"},"html":{"href":"https://github.com/dlang/dmd/pull/5737"},"issue":{"href":"https://api.github.com/repos/dlang/dmd/issues/5737"},"comments":{"href":"https://api.github.com/repos/dlang/dmd/issues/5737/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5737/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5737/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/dmd/statuses/9082f74b63122640efb518aa08f1ad004b1dcb2c"}}}}
{"actor":{"display_login":"ZombineDev"}}