{"action":"created","comment":{"url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/comments/175149180","pull_request_review_id":104638185,"id":175149180,"diff_hunk":"@@ -0,0 +1,217 @@\n+/**\n+ * Copyright: Copyright (c) 2017 Wojciech Szęszoł. All rights reserved.\n+ * Authors: Wojciech Szęszoł\n+ * Version: Initial created: October 13, 2017\n+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)\n+ */\n+import core.exception;\n+\n+import std.container.dlist;\n+import std.variant;\n+\n+import Common;\n+import Assert;\n+\n+import dstep.translator.MacroDefinition;\n+\n+unittest\n+{\n+    assertTranslates(q\"C\n+#define FOO(x) BAR(int)\n+C\", q\"D\n+extern (C):\n+\n+extern (D) auto FOO(T)(auto ref T x)\n+{\n+    return BAR(int);","path":"tests/unit/TypeInferenceTests.d","position":26,"original_position":26,"commit_id":"37b4dcf449e57479295fe1d2ee99faf3cd5de8be","original_commit_id":"965491440ba735c484e1223519acc936fcd4b2c0","user":{"login":"jacob-carlborg","id":306980,"avatar_url":"https://avatars1.githubusercontent.com/u/306980?v=4","gravatar_id":"","url":"https://api.github.com/users/jacob-carlborg","html_url":"https://github.com/jacob-carlborg","followers_url":"https://api.github.com/users/jacob-carlborg/followers","following_url":"https://api.github.com/users/jacob-carlborg/following{/other_user}","gists_url":"https://api.github.com/users/jacob-carlborg/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob-carlborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob-carlborg/subscriptions","organizations_url":"https://api.github.com/users/jacob-carlborg/orgs","repos_url":"https://api.github.com/users/jacob-carlborg/repos","events_url":"https://api.github.com/users/jacob-carlborg/events{/privacy}","received_events_url":"https://api.github.com/users/jacob-carlborg/received_events","type":"User","site_admin":false},"body":"No. The only thing I can think of is perhaps it's behind master.","created_at":"2018-03-16T16:42:32Z","updated_at":"2018-03-16T16:42:33Z","html_url":"https://github.com/jacob-carlborg/dstep/pull/178#discussion_r175149180","pull_request_url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/comments/175149180"},"html":{"href":"https://github.com/jacob-carlborg/dstep/pull/178#discussion_r175149180"},"pull_request":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178"}},"in_reply_to_id":148967107},"pull_request":{"url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178","id":147649549,"html_url":"https://github.com/jacob-carlborg/dstep/pull/178","diff_url":"https://github.com/jacob-carlborg/dstep/pull/178.diff","patch_url":"https://github.com/jacob-carlborg/dstep/pull/178.patch","issue_url":"https://api.github.com/repos/jacob-carlborg/dstep/issues/178","number":178,"state":"open","locked":false,"title":"Fix #141: Improve type inference for macros, in particular handle type arguments.","user":{"login":"ciechowoj","id":7858228,"avatar_url":"https://avatars1.githubusercontent.com/u/7858228?v=4","gravatar_id":"","url":"https://api.github.com/users/ciechowoj","html_url":"https://github.com/ciechowoj","followers_url":"https://api.github.com/users/ciechowoj/followers","following_url":"https://api.github.com/users/ciechowoj/following{/other_user}","gists_url":"https://api.github.com/users/ciechowoj/gists{/gist_id}","starred_url":"https://api.github.com/users/ciechowoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciechowoj/subscriptions","organizations_url":"https://api.github.com/users/ciechowoj/orgs","repos_url":"https://api.github.com/users/ciechowoj/repos","events_url":"https://api.github.com/users/ciechowoj/events{/privacy}","received_events_url":"https://api.github.com/users/ciechowoj/received_events","type":"User","site_admin":false},"body":"The commit learns dstep to infer the signature of the macro basing on usage. It is still quite rudimentary implementation but it handles the cases that were wrong before anyway. Example:\r\n\r\n```\r\nassertTranslates(q\"C\r\n#define BAR(x, y, z) x * y * sizeof(z)\r\n\r\n#define BAZ BAR(0, 1, float)\r\nC\", q\"D\r\nextern (C):\r\n\r\nextern (D) auto BAR(z, T0, T1)(auto ref T0 x, auto ref T1 y)\r\n{\r\n    return x * y * z.sizeof;\r\n}\r\n\r\nenum BAZ = BAR!float(0, 1);\r\nD\");\r\n```\r\n\r\nMore examples in unit tests.\r\n\r\n\r\n\r\n\r\n","created_at":"2017-10-19T19:51:51Z","updated_at":"2018-03-16T16:42:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b9e51be02c8f23c25cb1c118a60d9e76de809f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178/commits","review_comments_url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178/comments","review_comment_url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jacob-carlborg/dstep/issues/178/comments","statuses_url":"https://api.github.com/repos/jacob-carlborg/dstep/statuses/37b4dcf449e57479295fe1d2ee99faf3cd5de8be","head":{"label":"ciechowoj:feature-infer-param-types-from-usage","ref":"feature-infer-param-types-from-usage","sha":"37b4dcf449e57479295fe1d2ee99faf3cd5de8be","user":{"login":"ciechowoj","id":7858228,"avatar_url":"https://avatars1.githubusercontent.com/u/7858228?v=4","gravatar_id":"","url":"https://api.github.com/users/ciechowoj","html_url":"https://github.com/ciechowoj","followers_url":"https://api.github.com/users/ciechowoj/followers","following_url":"https://api.github.com/users/ciechowoj/following{/other_user}","gists_url":"https://api.github.com/users/ciechowoj/gists{/gist_id}","starred_url":"https://api.github.com/users/ciechowoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciechowoj/subscriptions","organizations_url":"https://api.github.com/users/ciechowoj/orgs","repos_url":"https://api.github.com/users/ciechowoj/repos","events_url":"https://api.github.com/users/ciechowoj/events{/privacy}","received_events_url":"https://api.github.com/users/ciechowoj/received_events","type":"User","site_admin":false},"repo":{"id":50794645,"name":"dstep","full_name":"ciechowoj/dstep","owner":{"login":"ciechowoj","id":7858228,"avatar_url":"https://avatars1.githubusercontent.com/u/7858228?v=4","gravatar_id":"","url":"https://api.github.com/users/ciechowoj","html_url":"https://github.com/ciechowoj","followers_url":"https://api.github.com/users/ciechowoj/followers","following_url":"https://api.github.com/users/ciechowoj/following{/other_user}","gists_url":"https://api.github.com/users/ciechowoj/gists{/gist_id}","starred_url":"https://api.github.com/users/ciechowoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciechowoj/subscriptions","organizations_url":"https://api.github.com/users/ciechowoj/orgs","repos_url":"https://api.github.com/users/ciechowoj/repos","events_url":"https://api.github.com/users/ciechowoj/events{/privacy}","received_events_url":"https://api.github.com/users/ciechowoj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ciechowoj/dstep","description":"A tool for converting C and Objective-C headers to D modules","fork":true,"url":"https://api.github.com/repos/ciechowoj/dstep","forks_url":"https://api.github.com/repos/ciechowoj/dstep/forks","keys_url":"https://api.github.com/repos/ciechowoj/dstep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ciechowoj/dstep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ciechowoj/dstep/teams","hooks_url":"https://api.github.com/repos/ciechowoj/dstep/hooks","issue_events_url":"https://api.github.com/repos/ciechowoj/dstep/issues/events{/number}","events_url":"https://api.github.com/repos/ciechowoj/dstep/events","assignees_url":"https://api.github.com/repos/ciechowoj/dstep/assignees{/user}","branches_url":"https://api.github.com/repos/ciechowoj/dstep/branches{/branch}","tags_url":"https://api.github.com/repos/ciechowoj/dstep/tags","blobs_url":"https://api.github.com/repos/ciechowoj/dstep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ciechowoj/dstep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ciechowoj/dstep/git/refs{/sha}","trees_url":"https://api.github.com/repos/ciechowoj/dstep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ciechowoj/dstep/statuses/{sha}","languages_url":"https://api.github.com/repos/ciechowoj/dstep/languages","stargazers_url":"https://api.github.com/repos/ciechowoj/dstep/stargazers","contributors_url":"https://api.github.com/repos/ciechowoj/dstep/contributors","subscribers_url":"https://api.github.com/repos/ciechowoj/dstep/subscribers","subscription_url":"https://api.github.com/repos/ciechowoj/dstep/subscription","commits_url":"https://api.github.com/repos/ciechowoj/dstep/commits{/sha}","git_commits_url":"https://api.github.com/repos/ciechowoj/dstep/git/commits{/sha}","comments_url":"https://api.github.com/repos/ciechowoj/dstep/comments{/number}","issue_comment_url":"https://api.github.com/repos/ciechowoj/dstep/issues/comments{/number}","contents_url":"https://api.github.com/repos/ciechowoj/dstep/contents/{+path}","compare_url":"https://api.github.com/repos/ciechowoj/dstep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ciechowoj/dstep/merges","archive_url":"https://api.github.com/repos/ciechowoj/dstep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ciechowoj/dstep/downloads","issues_url":"https://api.github.com/repos/ciechowoj/dstep/issues{/number}","pulls_url":"https://api.github.com/repos/ciechowoj/dstep/pulls{/number}","milestones_url":"https://api.github.com/repos/ciechowoj/dstep/milestones{/number}","notifications_url":"https://api.github.com/repos/ciechowoj/dstep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ciechowoj/dstep/labels{/name}","releases_url":"https://api.github.com/repos/ciechowoj/dstep/releases{/id}","deployments_url":"https://api.github.com/repos/ciechowoj/dstep/deployments","created_at":"2016-01-31T20:53:41Z","updated_at":"2016-12-17T12:43:44Z","pushed_at":"2018-03-16T15:40:42Z","git_url":"git://github.com/ciechowoj/dstep.git","ssh_url":"git@github.com:ciechowoj/dstep.git","clone_url":"https://github.com/ciechowoj/dstep.git","svn_url":"https://github.com/ciechowoj/dstep","homepage":"","size":1255,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"jacob-carlborg:master","ref":"master","sha":"fca0e905886ea5d60cdc5417fada7924d3d6083e","user":{"login":"jacob-carlborg","id":306980,"avatar_url":"https://avatars1.githubusercontent.com/u/306980?v=4","gravatar_id":"","url":"https://api.github.com/users/jacob-carlborg","html_url":"https://github.com/jacob-carlborg","followers_url":"https://api.github.com/users/jacob-carlborg/followers","following_url":"https://api.github.com/users/jacob-carlborg/following{/other_user}","gists_url":"https://api.github.com/users/jacob-carlborg/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob-carlborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob-carlborg/subscriptions","organizations_url":"https://api.github.com/users/jacob-carlborg/orgs","repos_url":"https://api.github.com/users/jacob-carlborg/repos","events_url":"https://api.github.com/users/jacob-carlborg/events{/privacy}","received_events_url":"https://api.github.com/users/jacob-carlborg/received_events","type":"User","site_admin":false},"repo":{"id":2494736,"name":"dstep","full_name":"jacob-carlborg/dstep","owner":{"login":"jacob-carlborg","id":306980,"avatar_url":"https://avatars1.githubusercontent.com/u/306980?v=4","gravatar_id":"","url":"https://api.github.com/users/jacob-carlborg","html_url":"https://github.com/jacob-carlborg","followers_url":"https://api.github.com/users/jacob-carlborg/followers","following_url":"https://api.github.com/users/jacob-carlborg/following{/other_user}","gists_url":"https://api.github.com/users/jacob-carlborg/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob-carlborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob-carlborg/subscriptions","organizations_url":"https://api.github.com/users/jacob-carlborg/orgs","repos_url":"https://api.github.com/users/jacob-carlborg/repos","events_url":"https://api.github.com/users/jacob-carlborg/events{/privacy}","received_events_url":"https://api.github.com/users/jacob-carlborg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacob-carlborg/dstep","description":"A tool for converting C and Objective-C headers to D modules","fork":false,"url":"https://api.github.com/repos/jacob-carlborg/dstep","forks_url":"https://api.github.com/repos/jacob-carlborg/dstep/forks","keys_url":"https://api.github.com/repos/jacob-carlborg/dstep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacob-carlborg/dstep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacob-carlborg/dstep/teams","hooks_url":"https://api.github.com/repos/jacob-carlborg/dstep/hooks","issue_events_url":"https://api.github.com/repos/jacob-carlborg/dstep/issues/events{/number}","events_url":"https://api.github.com/repos/jacob-carlborg/dstep/events","assignees_url":"https://api.github.com/repos/jacob-carlborg/dstep/assignees{/user}","branches_url":"https://api.github.com/repos/jacob-carlborg/dstep/branches{/branch}","tags_url":"https://api.github.com/repos/jacob-carlborg/dstep/tags","blobs_url":"https://api.github.com/repos/jacob-carlborg/dstep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacob-carlborg/dstep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacob-carlborg/dstep/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacob-carlborg/dstep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacob-carlborg/dstep/statuses/{sha}","languages_url":"https://api.github.com/repos/jacob-carlborg/dstep/languages","stargazers_url":"https://api.github.com/repos/jacob-carlborg/dstep/stargazers","contributors_url":"https://api.github.com/repos/jacob-carlborg/dstep/contributors","subscribers_url":"https://api.github.com/repos/jacob-carlborg/dstep/subscribers","subscription_url":"https://api.github.com/repos/jacob-carlborg/dstep/subscription","commits_url":"https://api.github.com/repos/jacob-carlborg/dstep/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacob-carlborg/dstep/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacob-carlborg/dstep/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacob-carlborg/dstep/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacob-carlborg/dstep/contents/{+path}","compare_url":"https://api.github.com/repos/jacob-carlborg/dstep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacob-carlborg/dstep/merges","archive_url":"https://api.github.com/repos/jacob-carlborg/dstep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacob-carlborg/dstep/downloads","issues_url":"https://api.github.com/repos/jacob-carlborg/dstep/issues{/number}","pulls_url":"https://api.github.com/repos/jacob-carlborg/dstep/pulls{/number}","milestones_url":"https://api.github.com/repos/jacob-carlborg/dstep/milestones{/number}","notifications_url":"https://api.github.com/repos/jacob-carlborg/dstep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacob-carlborg/dstep/labels{/name}","releases_url":"https://api.github.com/repos/jacob-carlborg/dstep/releases{/id}","deployments_url":"https://api.github.com/repos/jacob-carlborg/dstep/deployments","created_at":"2011-10-01T12:33:12Z","updated_at":"2018-02-17T14:37:00Z","pushed_at":"2018-03-16T15:40:44Z","git_url":"git://github.com/jacob-carlborg/dstep.git","ssh_url":"git@github.com:jacob-carlborg/dstep.git","clone_url":"https://github.com/jacob-carlborg/dstep.git","svn_url":"https://github.com/jacob-carlborg/dstep","homepage":"","size":1239,"stargazers_count":124,"watchers_count":124,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":29,"license":null,"forks":17,"open_issues":29,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178"},"html":{"href":"https://github.com/jacob-carlborg/dstep/pull/178"},"issue":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/issues/178"},"comments":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/jacob-carlborg/dstep/statuses/37b4dcf449e57479295fe1d2ee99faf3cd5de8be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jacob-carlborg"}}