{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/comments/48218701","id":48218701,"diff_hunk":"@@ -740,27 +736,52 @@ private static void RegisterGrainReferenceSerializers(Type type)\n                 GrainReference.SerializeGrainReference,\n                 (expected, stream) =>\n                 {\n-                    ConstructorInfo constructor;\n-                    if (expected.IsConstructedGenericType)\n+                    Func<GrainReference, GrainReference> ctorDelegate;\n+                    var deserialized = (GrainReference)GrainReference.DeserializeGrainReference(expected, stream);\n+                    if (expected.IsConstructedGenericType == false)\n                     {\n-                        var referenceType = type.MakeGenericType(expected.GenericTypeArguments);\n-                        constructor =\n-                            referenceType.GetConstructor(\n-                                BindingFlags.CreateInstance | BindingFlags.NonPublic | BindingFlags.Instance,\n-                                null,\n-                                new[] { typeof(GrainReference) },\n-                                null);\n+                        return defaultCtorDelegate(deserialized);\n                     }\n-                    else\n+\n+                    if (grainRefConstructorDictionary.TryGetValue(expected, out ctorDelegate) == false)","path":"src/Orleans/Serialization/SerializationManager.cs","position":75,"original_position":75,"commit_id":"c0b69290c3ba59b23b979a675e3268e74c95ee45","original_commit_id":"c0b69290c3ba59b23b979a675e3268e74c95ee45","user":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"body":"Interesting theory, I disagree, but this is stylistic and not important, so LGTM.","created_at":"2015-12-22T03:22:36Z","updated_at":"2015-12-22T03:22:36Z","html_url":"https://github.com/dotnet/orleans/pull/1197#discussion_r48218701","pull_request_url":"https://api.github.com/repos/dotnet/orleans/pulls/1197","_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments/48218701"},"html":{"href":"https://github.com/dotnet/orleans/pull/1197#discussion_r48218701"},"pull_request":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1197"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/1197","id":54325776,"html_url":"https://github.com/dotnet/orleans/pull/1197","diff_url":"https://github.com/dotnet/orleans/pull/1197.diff","patch_url":"https://github.com/dotnet/orleans/pull/1197.patch","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/1197","number":1197,"state":"open","locked":false,"title":"Convert some reflection-based code to compiled expressions","user":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"body":"modified some code that was using reflection to use compiled expressions.","created_at":"2015-12-22T02:16:00Z","updated_at":"2015-12-22T03:22:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c4f29e4df0cbc78788c48e2c02212792c3717aa","assignee":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars.githubusercontent.com/u/203839?v=3","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/orleans/pulls/1197/commits","review_comments_url":"https://api.github.com/repos/dotnet/orleans/pulls/1197/comments","review_comment_url":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1197/comments","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/c0b69290c3ba59b23b979a675e3268e74c95ee45","head":{"label":"Carlm-MS:Carlm-ReflectionToIL","ref":"Carlm-ReflectionToIL","sha":"c0b69290c3ba59b23b979a675e3268e74c95ee45","user":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"repo":{"id":45006245,"name":"orleans","full_name":"Carlm-MS/orleans","owner":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Carlm-MS/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":true,"url":"https://api.github.com/repos/Carlm-MS/orleans","forks_url":"https://api.github.com/repos/Carlm-MS/orleans/forks","keys_url":"https://api.github.com/repos/Carlm-MS/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Carlm-MS/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Carlm-MS/orleans/teams","hooks_url":"https://api.github.com/repos/Carlm-MS/orleans/hooks","issue_events_url":"https://api.github.com/repos/Carlm-MS/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/Carlm-MS/orleans/events","assignees_url":"https://api.github.com/repos/Carlm-MS/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/Carlm-MS/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/Carlm-MS/orleans/tags","blobs_url":"https://api.github.com/repos/Carlm-MS/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Carlm-MS/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Carlm-MS/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/Carlm-MS/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Carlm-MS/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/Carlm-MS/orleans/languages","stargazers_url":"https://api.github.com/repos/Carlm-MS/orleans/stargazers","contributors_url":"https://api.github.com/repos/Carlm-MS/orleans/contributors","subscribers_url":"https://api.github.com/repos/Carlm-MS/orleans/subscribers","subscription_url":"https://api.github.com/repos/Carlm-MS/orleans/subscription","commits_url":"https://api.github.com/repos/Carlm-MS/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/Carlm-MS/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/Carlm-MS/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/Carlm-MS/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/Carlm-MS/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/Carlm-MS/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Carlm-MS/orleans/merges","archive_url":"https://api.github.com/repos/Carlm-MS/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Carlm-MS/orleans/downloads","issues_url":"https://api.github.com/repos/Carlm-MS/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/Carlm-MS/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/Carlm-MS/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/Carlm-MS/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Carlm-MS/orleans/labels{/name}","releases_url":"https://api.github.com/repos/Carlm-MS/orleans/releases{/id}","created_at":"2015-10-27T00:16:59Z","updated_at":"2015-10-27T00:17:03Z","pushed_at":"2015-12-22T02:09:02Z","git_url":"git://github.com/Carlm-MS/orleans.git","ssh_url":"git@github.com:Carlm-MS/orleans.git","clone_url":"https://github.com/Carlm-MS/orleans.git","svn_url":"https://github.com/Carlm-MS/orleans","homepage":"http://dotnet.github.io/orleans","size":11564,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"5cbdaa6b77ae9165ed71edf30b7e9b764c104061","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28232663,"name":"orleans","full_name":"dotnet/orleans","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":false,"url":"https://api.github.com/repos/dotnet/orleans","forks_url":"https://api.github.com/repos/dotnet/orleans/forks","keys_url":"https://api.github.com/repos/dotnet/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/orleans/teams","hooks_url":"https://api.github.com/repos/dotnet/orleans/hooks","issue_events_url":"https://api.github.com/repos/dotnet/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/orleans/events","assignees_url":"https://api.github.com/repos/dotnet/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/orleans/tags","blobs_url":"https://api.github.com/repos/dotnet/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/orleans/languages","stargazers_url":"https://api.github.com/repos/dotnet/orleans/stargazers","contributors_url":"https://api.github.com/repos/dotnet/orleans/contributors","subscribers_url":"https://api.github.com/repos/dotnet/orleans/subscribers","subscription_url":"https://api.github.com/repos/dotnet/orleans/subscription","commits_url":"https://api.github.com/repos/dotnet/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/orleans/merges","archive_url":"https://api.github.com/repos/dotnet/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/orleans/downloads","issues_url":"https://api.github.com/repos/dotnet/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/orleans/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/orleans/releases{/id}","created_at":"2014-12-19T14:32:50Z","updated_at":"2015-12-21T20:16:15Z","pushed_at":"2015-12-22T02:42:08Z","git_url":"git://github.com/dotnet/orleans.git","ssh_url":"git@github.com:dotnet/orleans.git","clone_url":"https://github.com/dotnet/orleans.git","svn_url":"https://github.com/dotnet/orleans","homepage":"http://dotnet.github.io/orleans","size":29745,"stargazers_count":1396,"watchers_count":1396,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":337,"mirror_url":null,"open_issues_count":120,"forks":337,"open_issues":120,"watchers":1396,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1197"},"html":{"href":"https://github.com/dotnet/orleans/pull/1197"},"issue":{"href":"https://api.github.com/repos/dotnet/orleans/issues/1197"},"comments":{"href":"https://api.github.com/repos/dotnet/orleans/issues/1197/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1197/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1197/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/orleans/statuses/c0b69290c3ba59b23b979a675e3268e74c95ee45"}}}}