{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/74795604","id":74795604,"diff_hunk":"@@ -1765,6 +1767,21 @@ private void EmitObjectCreationExpression(BoundObjectCreationExpression expressi\n             }\n         }\n \n+        private bool ConstructorNotSideEffecting(BoundObjectCreationExpression expression)\n+        {\n+            var originalDef = expression.Constructor.OriginalDefinition;\n+\n+            return originalDef == _module.Compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T1__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T2__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T3__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T4__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T5__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T6__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_T7__ctor) ||\n+                originalDef == _module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ValueTuple_TRest__ctor);","path":"src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs","position":34,"original_position":34,"commit_id":"b9b85ded939cebb5f922752b39f57d920498fdaf","original_commit_id":"b9b85ded939cebb5f922752b39f57d920498fdaf","user":{"login":"jcouv","id":12466233,"avatar_url":"https://avatars.githubusercontent.com/u/12466233?v=3","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-08-15T17:10:14Z","updated_at":"2016-08-15T17:10:14Z","html_url":"https://github.com/dotnet/roslyn/pull/13115#discussion_r74795604","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/13115","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/74795604"},"html":{"href":"https://github.com/dotnet/roslyn/pull/13115#discussion_r74795604"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/13115"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/13115","id":81072811,"html_url":"https://github.com/dotnet/roslyn/pull/13115","diff_url":"https://github.com/dotnet/roslyn/pull/13115.diff","patch_url":"https://github.com/dotnet/roslyn/pull/13115.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/13115","number":13115,"state":"open","locked":false,"title":"D-assignment should return a tuple instead of void","user":{"login":"jcouv","id":12466233,"avatar_url":"https://avatars.githubusercontent.com/u/12466233?v=3","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false},"body":"With this change, `var t = (x, y) = (1, 2);` is now allowed and `t` is a tuple.\r\nThis works with long tuples and nested deconstruction as well.\r\n\r\nIn the process, I had to include the fix for the evaluation order. The new order is:\r\n1. Evaluate all the LHS variables for side-effects\r\n2. Evaluate all the RHS elements (with conversions for tuple literals) \r\n      - If the RHS is a tuple literal (even if it has a natural type), it gets a type by conversion to a \"merged tuple type\"\r\n3. Do all deconstructions\r\n4. Apply Conversions\r\n5. Assign converted values to LHS variables\r\n6. Produce a tuple with the converted values (that construction of `ValueTuple` is not emitted unless it is consumed, as we require the construction of `ValueTuple` to be side-effect-free)\r\n\r\nAs a result of this change, you need to reference the ValueTuple library whenever using deconstructions.\r\n\r\nAlso, you can see that more locals are created to store the outputs of conversions at step (4). I think we should be able to optimize in some more cases.\r\n\r\nFixes https://github.com/dotnet/roslyn/issues/12635 (return type) and https://github.com/dotnet/roslyn/issues/12400 (evaluation order).\r\n\r\nFYI for @MadsTorgersen regarding evaluation order.","created_at":"2016-08-12T06:25:30Z","updated_at":"2016-08-15T17:10:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59577850b1414674d71ac8b8183d3d76aed1d905","assignee":{"login":"jcouv","id":12466233,"avatar_url":"https://avatars.githubusercontent.com/u/12466233?v=3","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false},"assignees":[{"login":"jcouv","id":12466233,"avatar_url":"https://avatars.githubusercontent.com/u/12466233?v=3","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/13115/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/13115/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/13115/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/b9b85ded939cebb5f922752b39f57d920498fdaf","head":{"label":"jcouv:return-type","ref":"return-type","sha":"b9b85ded939cebb5f922752b39f57d920498fdaf","user":{"login":"jcouv","id":12466233,"avatar_url":"https://avatars.githubusercontent.com/u/12466233?v=3","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false},"repo":{"id":50162064,"name":"roslyn","full_name":"jcouv/roslyn","owner":{"login":"jcouv","id":12466233,"avatar_url":"https://avatars.githubusercontent.com/u/12466233?v=3","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcouv/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/jcouv/roslyn","forks_url":"https://api.github.com/repos/jcouv/roslyn/forks","keys_url":"https://api.github.com/repos/jcouv/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcouv/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcouv/roslyn/teams","hooks_url":"https://api.github.com/repos/jcouv/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jcouv/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jcouv/roslyn/events","assignees_url":"https://api.github.com/repos/jcouv/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jcouv/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jcouv/roslyn/tags","blobs_url":"https://api.github.com/repos/jcouv/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcouv/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcouv/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcouv/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcouv/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jcouv/roslyn/languages","stargazers_url":"https://api.github.com/repos/jcouv/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jcouv/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jcouv/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jcouv/roslyn/subscription","commits_url":"https://api.github.com/repos/jcouv/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcouv/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcouv/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcouv/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcouv/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jcouv/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcouv/roslyn/merges","archive_url":"https://api.github.com/repos/jcouv/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcouv/roslyn/downloads","issues_url":"https://api.github.com/repos/jcouv/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jcouv/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jcouv/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jcouv/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcouv/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jcouv/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/jcouv/roslyn/deployments","created_at":"2016-01-22T06:19:22Z","updated_at":"2016-01-22T06:19:52Z","pushed_at":"2016-08-12T22:16:34Z","git_url":"git://github.com/jcouv/roslyn.git","ssh_url":"git@github.com:jcouv/roslyn.git","clone_url":"https://github.com/jcouv/roslyn.git","svn_url":"https://github.com/jcouv/roslyn","homepage":"","size":166708,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"dotnet:master","ref":"master","sha":"8eafb6f4a806ac4279e2a4d7b5d5ee514fb50e0d","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":29078997,"name":"roslyn","full_name":"dotnet/roslyn","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/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2016-08-15T08:54:18Z","pushed_at":"2016-08-15T16:12:38Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":322610,"stargazers_count":6006,"watchers_count":6006,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1440,"mirror_url":null,"open_issues_count":3136,"forks":1440,"open_issues":3136,"watchers":6006,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/13115"},"html":{"href":"https://github.com/dotnet/roslyn/pull/13115"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/13115"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/13115/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/13115/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/13115/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/b9b85ded939cebb5f922752b39f57d920498fdaf"}}}}
{"actor":{"display_login":"jcouv"}}