{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/12104","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/12104/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/12104/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/12104/events","html_url":"https://github.com/dotnet/roslyn/pull/12104","id":161256067,"number":12104,"title":"Deconstruction-declaration parsing for local declaration, for and foreach","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},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"009800"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/New%20Language%20Feature%20-%20Tuples","name":"New Language Feature - Tuples","color":"bfd4f2"}],"state":"open","locked":false,"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},"milestone":null,"comments":2,"created_at":"2016-06-20T17:59:37Z","updated_at":"2016-06-21T16:29:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/12104","html_url":"https://github.com/dotnet/roslyn/pull/12104","diff_url":"https://github.com/dotnet/roslyn/pull/12104.diff","patch_url":"https://github.com/dotnet/roslyn/pull/12104.patch"},"body":"Adds parsing for three deconstruction-declaration contexts. Other contexts (such as `let` or `from` will be added later).\r\n\r\n@dotnet/roslyn-compiler for review. Thanks\r\n\r\n```C#\r\n// All those are parsed as a LocalDeclarationStatement, except that its VariableDeclaration is extended to hold a DeconstructionDeclaration\r\n// DeconstructionDeclaration is DeconstructionVariables + equalsToken + expression\r\n(Int32 a, Int64 b) = foo;\r\n((Int32 a, Int64 b), Int32 c) = foo;\r\nvar (a, b) = foo;\r\nvar ((a, b), c) = foo;\r\n(Int32 x, var (y, z)) = foo; // var syntax inside list syntax\r\n\r\n// This is still a method call\r\nvar(a, b);\r\n\r\n// ForStatement with the VariableDeclaration holding a DeconstructionDeclaration\r\nfor ((Int32 x, Int64 y) = foo; ; ) { }\r\nfor (var (x, y) = foo; ; ) { }\r\n\r\n// Foreach statement which is extended to hold DeconstructionVariables\r\nforeach ((int x, var y) in foo) { }\r\nforeach (var (x, y) in foo) { }\r\n```\r\n\r\nNote 1: because my VS is busted, I expect some public API errors. I will fix that before checking in.\r\n\r\nNote 2: this change includes a copy of Aleksey's recent change in outvar branch to support Internal=\"true\" in Syntax.xml, which will help maintain a backwards compatible public API."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/227495485","html_url":"https://github.com/dotnet/roslyn/pull/12104#issuecomment-227495485","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/12104","id":227495485,"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},"created_at":"2016-06-21T16:29:30Z","updated_at":"2016-06-21T16:29:30Z","body":"@dotnet/roslyn-compiler This is ready to review again. \r\n\r\nTwo examples:\r\n\r\n1. `var (x, (y, z)) = expression` gets parsed as a `VariableDeclaration` with `type`=`var`, no regular declarators, and the new `deconstruction` declarator holding the rest. \r\nThat deconstruction declarator has two variables, each which is a `VariableDeclaration` where `type` is `null`. \r\nFor the first one, the `x` is inside the regular declarator.\r\nFor the second one, the two variables are inside the deconstruction declarator. \r\n\r\n\r\n2. `(int x, int y) = expression` gets parsed as a `VariableDeclaration` with no `type`, no regular declarators, and the `deconstruction` declarator holding everything. \r\nThat deconstruction declarator has two variables, each which are held as a `VariableDeclaration` with `type`=`int` and the name of the variable inside the regular declarator.\r\n\r\nTo recap, `VariableDeclaration` is used in four ways:\r\n\r\n1. `type` is `var`, `declarator`=`null` and `deconstruction` is set. Example: `var (...) = ...`\r\n2. `type` is null, `declarator`=`null` and `deconstruction` is set. Example: `(int x, int y)`\r\n3. `type` is set, `declarator` is set with one element with just a name and `deconstruction` is null, as before. Example: `int x` in `(int x, int y) = ...`\r\n4. `type` is null, `declarator` is set with one element with just a name and `deconstruction` is null. Example: `y` in `var (x, y) = ...`"}}
{"actor":{"display_login":"jcouv"}}