{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/6400","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400/events","html_url":"https://github.com/dotnet/roslyn/issues/6400","id":113917694,"number":6400,"title":"Proposal: Destructuring (assignment?) statement","user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Feature%20Request","name":"Feature Request","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/8","html_url":"https://github.com/dotnet/roslyn/milestones/C%23%207%20and%20VB%2015","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/8/labels","id":962632,"number":8,"title":"C# 7 and VB 15","description":"\r\n\r\n<!---\r\n@huboard:{\"order\":0.375}\r\n-->\r\n","creator":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"open_issues":60,"closed_issues":11,"state":"open","created_at":"2015-02-02T23:41:34Z","updated_at":"2015-10-30T19:15:44Z","due_on":null,"closed_at":null},"comments":89,"created_at":"2015-10-28T20:42:20Z","updated_at":"2015-11-05T20:02:07Z","closed_at":null,"body":"\r\nInspired by an [F# feature](https://msdn.microsoft.com/en-us/library/dd233238.aspx) and a [conversation on github](https://github.com/dotnet/roslyn/issues/5154#issuecomment-151974994), we could support decomposition like this:\r\n\r\n> *block-statement:*\r\n&nbsp;&nbsp;&nbsp;&nbsp;*let-statement*\r\n*let-statement:*\r\n&nbsp;&nbsp;&nbsp;&nbsp;`let` *identifier* `=` *expression* `;`\r\n&nbsp;&nbsp;&nbsp;&nbsp;`let` *complex-pattern* `=` *expression* `;`\r\n&nbsp;&nbsp;&nbsp;&nbsp;`let` *complex-pattern* `=` *expression* `;` `else` *embedded-statement*\r\n\r\n`let` is an existing contextual keyword.\r\n\r\nThe form\r\n> `let` *identifier* `=` *expression* `;`\r\n\r\nis shorthand for \r\n\r\n> `let` `var` *identifier* `=` *expression* `;`\r\n\r\n(i.e. a *var-pattern*) and is a convenient way for declaring a read-only local variable.\r\n\r\nSemantically, it is an error unless precisely one of the following is true\r\n1. the compiler can prove that the expression always matches the pattern; or\r\n2. an `else` clause is present.\r\n\r\nIf an `else` clause is present, it is an error if the endpoint of its *embedded-statement* is reachable.\r\n\r\nAny pattern variables in the *pattern* are in scope throughout the enclosing block and are definitely assigned (only) after the execution of the *let-statement* completes. It is an error to use these variables before their point of definition.\r\n\r\nA *let-statement* is a *block-statement* and not an *embedded-statement* because its primary purpose is to introduce names into the enclosing scope. It therefore does not introduce a dangling-else ambiguity.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/154174126","html_url":"https://github.com/dotnet/roslyn/issues/6400#issuecomment-154174126","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400","id":154174126,"user":{"login":"alrz","id":3105979,"avatar_url":"https://avatars.githubusercontent.com/u/3105979?v=3","gravatar_id":"","url":"https://api.github.com/users/alrz","html_url":"https://github.com/alrz","followers_url":"https://api.github.com/users/alrz/followers","following_url":"https://api.github.com/users/alrz/following{/other_user}","gists_url":"https://api.github.com/users/alrz/gists{/gist_id}","starred_url":"https://api.github.com/users/alrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alrz/subscriptions","organizations_url":"https://api.github.com/users/alrz/orgs","repos_url":"https://api.github.com/users/alrz/repos","events_url":"https://api.github.com/users/alrz/events{/privacy}","received_events_url":"https://api.github.com/users/alrz/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T20:02:07Z","updated_at":"2015-11-05T20:02:07Z","body":"@HaloFour but you did support my objection anyway :stuck_out_tongue_winking_eye: "}}