{"action":"created","comment":{"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/comments/61592507","id":61592507,"diff_hunk":"@@ -74,21 +74,88 @@ private static Delegate CreateDelegateProxy(Type typeOfProxy, MethodInfo invokeM\n         }\r\n \r\n         private static Expression CreateBodyExpression(\r\n-            MethodInfo delegateMethod, DelegateCallInterceptedEventRaiser eventRaiser, IEnumerable<Expression> parameterExpressions)\r\n+            MethodInfo delegateMethod,\r\n+            DelegateCallInterceptedEventRaiser eventRaiser,\r\n+            ParameterExpression[] parameterExpressions)\r\n         {\r\n-            var parameterExpressionsCastToObject =\r\n-                parameterExpressions.Select(x => Expression.Convert(x, typeof(object))).Cast<Expression>().ToArray();\r\n-\r\n-            Expression body = Expression.Call(\r\n+            /*********************************************************************\r\n+             * Generate a method that:\r\n+             * - wraps its arguments in an object array\r\n+             * - passes this array to eventRaiser.Raise()\r\n+             * - assigns the output values back to the ref/out parameters\r\n+             * - casts and returns the result of eventRaiser.Raise()\r\n+             *\r\n+             * For instance, for a delegate like this:\r\n+             *\r\n+             * delegate int Foo(int x, ref int y, out int z);\r\n+             *\r\n+             * We generate a method like this:\r\n+             *\r\n+             * int ProxyFoo(int x, ref int y, out int z)\r\n+             * {\r\n+             *     var arguments = new[]{ (object)x, (object)y, (object)z };\r\n+             *     var result = (int)eventRaiser.Raise(arguments);\r\n+             *     y = (int)arguments[1];\r\n+             *     z = (int)arguments[2];\r\n+             *     return result;\r\n+             * }\r\n+             ********************************************************************/\r","path":"src/FakeItEasy/Creation/DelegateProxies/DelegateProxyGenerator.cs","position":34,"original_position":34,"commit_id":"299d863b8fc6e2bab77527dce7ac9dae54a2fcc1","original_commit_id":"299d863b8fc6e2bab77527dce7ac9dae54a2fcc1","user":{"login":"thomaslevesque","id":1864281,"avatar_url":"https://avatars.githubusercontent.com/u/1864281?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaslevesque","html_url":"https://github.com/thomaslevesque","followers_url":"https://api.github.com/users/thomaslevesque/followers","following_url":"https://api.github.com/users/thomaslevesque/following{/other_user}","gists_url":"https://api.github.com/users/thomaslevesque/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaslevesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaslevesque/subscriptions","organizations_url":"https://api.github.com/users/thomaslevesque/orgs","repos_url":"https://api.github.com/users/thomaslevesque/repos","events_url":"https://api.github.com/users/thomaslevesque/events{/privacy}","received_events_url":"https://api.github.com/users/thomaslevesque/received_events","type":"User","site_admin":false},"body":"OK, I'll keep the `/* */` then","created_at":"2016-04-29T15:08:27Z","updated_at":"2016-04-29T15:08:27Z","html_url":"https://github.com/FakeItEasy/FakeItEasy/pull/690#discussion_r61592507","pull_request_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690","_links":{"self":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/comments/61592507"},"html":{"href":"https://github.com/FakeItEasy/FakeItEasy/pull/690#discussion_r61592507"},"pull_request":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690"}}},"pull_request":{"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690","id":68372153,"html_url":"https://github.com/FakeItEasy/FakeItEasy/pull/690","diff_url":"https://github.com/FakeItEasy/FakeItEasy/pull/690.diff","patch_url":"https://github.com/FakeItEasy/FakeItEasy/pull/690.patch","issue_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/690","number":690,"state":"open","locked":false,"title":"[WIP] Fix AssignsOutAndRefParameters for faked delegates","user":{"login":"thomaslevesque","id":1864281,"avatar_url":"https://avatars.githubusercontent.com/u/1864281?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaslevesque","html_url":"https://github.com/thomaslevesque","followers_url":"https://api.github.com/users/thomaslevesque/followers","following_url":"https://api.github.com/users/thomaslevesque/following{/other_user}","gists_url":"https://api.github.com/users/thomaslevesque/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaslevesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaslevesque/subscriptions","organizations_url":"https://api.github.com/users/thomaslevesque/orgs","repos_url":"https://api.github.com/users/thomaslevesque/repos","events_url":"https://api.github.com/users/thomaslevesque/events{/privacy}","received_events_url":"https://api.github.com/users/thomaslevesque/received_events","type":"User","site_admin":false},"body":"Fixes #677\r\n\r\nWIP because I still need to add specs\r\n\r\nI took into account the other remarks from https://github.com/thomaslevesque/FakeItEasy/commit/5570756fa1dbefc872804ad7a80bf3ad87aa9f5d","created_at":"2016-04-29T13:35:33Z","updated_at":"2016-04-29T15:08:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17555f8271144dd847c65d0281a6342545f2335e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690/commits","review_comments_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690/comments","review_comment_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/690/comments","statuses_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/statuses/299d863b8fc6e2bab77527dce7ac9dae54a2fcc1","head":{"label":"thomaslevesque:issue677","ref":"issue677","sha":"299d863b8fc6e2bab77527dce7ac9dae54a2fcc1","user":{"login":"thomaslevesque","id":1864281,"avatar_url":"https://avatars.githubusercontent.com/u/1864281?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaslevesque","html_url":"https://github.com/thomaslevesque","followers_url":"https://api.github.com/users/thomaslevesque/followers","following_url":"https://api.github.com/users/thomaslevesque/following{/other_user}","gists_url":"https://api.github.com/users/thomaslevesque/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaslevesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaslevesque/subscriptions","organizations_url":"https://api.github.com/users/thomaslevesque/orgs","repos_url":"https://api.github.com/users/thomaslevesque/repos","events_url":"https://api.github.com/users/thomaslevesque/events{/privacy}","received_events_url":"https://api.github.com/users/thomaslevesque/received_events","type":"User","site_admin":false},"repo":{"id":31570944,"name":"FakeItEasy","full_name":"thomaslevesque/FakeItEasy","owner":{"login":"thomaslevesque","id":1864281,"avatar_url":"https://avatars.githubusercontent.com/u/1864281?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaslevesque","html_url":"https://github.com/thomaslevesque","followers_url":"https://api.github.com/users/thomaslevesque/followers","following_url":"https://api.github.com/users/thomaslevesque/following{/other_user}","gists_url":"https://api.github.com/users/thomaslevesque/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaslevesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaslevesque/subscriptions","organizations_url":"https://api.github.com/users/thomaslevesque/orgs","repos_url":"https://api.github.com/users/thomaslevesque/repos","events_url":"https://api.github.com/users/thomaslevesque/events{/privacy}","received_events_url":"https://api.github.com/users/thomaslevesque/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thomaslevesque/FakeItEasy","description":"The easy mocking library for .NET","fork":true,"url":"https://api.github.com/repos/thomaslevesque/FakeItEasy","forks_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/forks","keys_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/teams","hooks_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/hooks","issue_events_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/issues/events{/number}","events_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/events","assignees_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/assignees{/user}","branches_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/branches{/branch}","tags_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/tags","blobs_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/git/refs{/sha}","trees_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/statuses/{sha}","languages_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/languages","stargazers_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/stargazers","contributors_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/contributors","subscribers_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/subscribers","subscription_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/subscription","commits_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/commits{/sha}","git_commits_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/git/commits{/sha}","comments_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/comments{/number}","issue_comment_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/issues/comments{/number}","contents_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/contents/{+path}","compare_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/merges","archive_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/downloads","issues_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/issues{/number}","pulls_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/pulls{/number}","milestones_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/milestones{/number}","notifications_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/labels{/name}","releases_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/releases{/id}","deployments_url":"https://api.github.com/repos/thomaslevesque/FakeItEasy/deployments","created_at":"2015-03-03T00:22:47Z","updated_at":"2016-01-13T20:13:45Z","pushed_at":"2016-04-29T13:34:39Z","git_url":"git://github.com/thomaslevesque/FakeItEasy.git","ssh_url":"git@github.com:thomaslevesque/FakeItEasy.git","clone_url":"https://github.com/thomaslevesque/FakeItEasy.git","svn_url":"https://github.com/thomaslevesque/FakeItEasy","homepage":"fakeiteasy.github.io","size":17599,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FakeItEasy:master","ref":"master","sha":"0fcb93593796aa73e18913b205d422fd0474c4b7","user":{"login":"FakeItEasy","id":1713521,"avatar_url":"https://avatars.githubusercontent.com/u/1713521?v=3","gravatar_id":"","url":"https://api.github.com/users/FakeItEasy","html_url":"https://github.com/FakeItEasy","followers_url":"https://api.github.com/users/FakeItEasy/followers","following_url":"https://api.github.com/users/FakeItEasy/following{/other_user}","gists_url":"https://api.github.com/users/FakeItEasy/gists{/gist_id}","starred_url":"https://api.github.com/users/FakeItEasy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FakeItEasy/subscriptions","organizations_url":"https://api.github.com/users/FakeItEasy/orgs","repos_url":"https://api.github.com/users/FakeItEasy/repos","events_url":"https://api.github.com/users/FakeItEasy/events{/privacy}","received_events_url":"https://api.github.com/users/FakeItEasy/received_events","type":"Organization","site_admin":false},"repo":{"id":1920133,"name":"FakeItEasy","full_name":"FakeItEasy/FakeItEasy","owner":{"login":"FakeItEasy","id":1713521,"avatar_url":"https://avatars.githubusercontent.com/u/1713521?v=3","gravatar_id":"","url":"https://api.github.com/users/FakeItEasy","html_url":"https://github.com/FakeItEasy","followers_url":"https://api.github.com/users/FakeItEasy/followers","following_url":"https://api.github.com/users/FakeItEasy/following{/other_user}","gists_url":"https://api.github.com/users/FakeItEasy/gists{/gist_id}","starred_url":"https://api.github.com/users/FakeItEasy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FakeItEasy/subscriptions","organizations_url":"https://api.github.com/users/FakeItEasy/orgs","repos_url":"https://api.github.com/users/FakeItEasy/repos","events_url":"https://api.github.com/users/FakeItEasy/events{/privacy}","received_events_url":"https://api.github.com/users/FakeItEasy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FakeItEasy/FakeItEasy","description":"The easy mocking library for .NET","fork":false,"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy","forks_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/forks","keys_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/teams","hooks_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/hooks","issue_events_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/events{/number}","events_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/events","assignees_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/assignees{/user}","branches_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/branches{/branch}","tags_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/tags","blobs_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/git/refs{/sha}","trees_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/statuses/{sha}","languages_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/languages","stargazers_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/stargazers","contributors_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/contributors","subscribers_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/subscribers","subscription_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/subscription","commits_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/commits{/sha}","git_commits_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/git/commits{/sha}","comments_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/comments{/number}","issue_comment_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/comments{/number}","contents_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/contents/{+path}","compare_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/merges","archive_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/downloads","issues_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues{/number}","pulls_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls{/number}","milestones_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/milestones{/number}","notifications_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/labels{/name}","releases_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/releases{/id}","deployments_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/deployments","created_at":"2011-06-19T17:56:01Z","updated_at":"2016-04-29T14:43:24Z","pushed_at":"2016-04-29T13:35:33Z","git_url":"git://github.com/FakeItEasy/FakeItEasy.git","ssh_url":"git@github.com:FakeItEasy/FakeItEasy.git","clone_url":"https://github.com/FakeItEasy/FakeItEasy.git","svn_url":"https://github.com/FakeItEasy/FakeItEasy","homepage":"fakeiteasy.github.io","size":18521,"stargazers_count":503,"watchers_count":503,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":51,"forks":107,"open_issues":51,"watchers":503,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690"},"html":{"href":"https://github.com/FakeItEasy/FakeItEasy/pull/690"},"issue":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/690"},"comments":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/690/comments"},"review_comments":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690/comments"},"review_comment":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/pulls/690/commits"},"statuses":{"href":"https://api.github.com/repos/FakeItEasy/FakeItEasy/statuses/299d863b8fc6e2bab77527dce7ac9dae54a2fcc1"}}}}