{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/13746","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/13746/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/13746/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/13746/events","html_url":"https://github.com/dotnet/corefx/issues/13746","id":189926441,"number":13746,"title":"Proposal: Supporting C# 7 deconstruction of certain types.","user":{"login":"jamesqo","id":9159214,"avatar_url":"https://avatars.githubusercontent.com/u/9159214?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesqo","html_url":"https://github.com/jamesqo","followers_url":"https://api.github.com/users/jamesqo/followers","following_url":"https://api.github.com/users/jamesqo/following{/other_user}","gists_url":"https://api.github.com/users/jamesqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesqo/subscriptions","organizations_url":"https://api.github.com/users/jamesqo/orgs","repos_url":"https://api.github.com/users/jamesqo/repos","events_url":"https://api.github.com/users/jamesqo/events{/privacy}","received_events_url":"https://api.github.com/users/jamesqo/received_events","type":"User","site_admin":false},"labels":[{"id":163655927,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-approved","name":"api-approved","color":"159818","default":false},{"id":158885797,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-Meta","name":"area-Meta","color":"d4c5f9","default":false},{"id":337781680,"url":"https://api.github.com/repos/dotnet/corefx/labels/netfx-port-consider","name":"netfx-port-consider","color":"5319e7","default":false},{"id":145399958,"url":"https://api.github.com/repos/dotnet/corefx/labels/up%20for%20grabs","name":"up for grabs","color":"159818","default":false}],"state":"open","locked":false,"assignee":{"login":"AlexRadch","id":6407980,"avatar_url":"https://avatars.githubusercontent.com/u/6407980?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexRadch","html_url":"https://github.com/AlexRadch","followers_url":"https://api.github.com/users/AlexRadch/followers","following_url":"https://api.github.com/users/AlexRadch/following{/other_user}","gists_url":"https://api.github.com/users/AlexRadch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexRadch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexRadch/subscriptions","organizations_url":"https://api.github.com/users/AlexRadch/orgs","repos_url":"https://api.github.com/users/AlexRadch/repos","events_url":"https://api.github.com/users/AlexRadch/events{/privacy}","received_events_url":"https://api.github.com/users/AlexRadch/received_events","type":"User","site_admin":false},"assignees":[{"login":"AlexRadch","id":6407980,"avatar_url":"https://avatars.githubusercontent.com/u/6407980?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexRadch","html_url":"https://github.com/AlexRadch","followers_url":"https://api.github.com/users/AlexRadch/followers","following_url":"https://api.github.com/users/AlexRadch/following{/other_user}","gists_url":"https://api.github.com/users/AlexRadch/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexRadch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexRadch/subscriptions","organizations_url":"https://api.github.com/users/AlexRadch/orgs","repos_url":"https://api.github.com/users/AlexRadch/repos","events_url":"https://api.github.com/users/AlexRadch/events{/privacy}","received_events_url":"https://api.github.com/users/AlexRadch/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking the issues triaged for an unspecified future release","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":691,"closed_issues":1,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2016-12-08T18:13:58Z","due_on":null,"closed_at":null},"comments":22,"created_at":"2016-11-17T03:32:42Z","updated_at":"2016-12-08T19:47:47Z","closed_at":null,"body":"## Background\r\n\r\nC# 7 added support for deconstruction of user-defined types via a `Deconstruct(out ...)` method. ([see it in action](http://tryroslyn.azurewebsites.net/#b:master/K4Zwlgdg5gBAygTxAFwKYFsDcAoADsAIwBswBjGUogQxBBgGEYBvbGNmfYsmANwHswAExgARVKT4QUAJ2ClkACj7BkMSMgDaAXRhUANDGWr1MAgaNqIq0gEpW7Fuye6YAXhgRgRIjmfsCbjAADL5+FIEh9mwAvtixeIQk5JQ0dCLYjuycSbwCwgCyCnZOmX48VNLh7hCoAO4MRaFlFTAK+jCoBoI2gaRNMLHRQA=)) It would make sense to be able to use this feature with tuple-like types such as `KeyValuePair` and `DictionaryEntry`.\r\n\r\n## Proposal\r\n\r\n```cs\r\npublic struct KeyValuePair<TKey, TValue>\r\n{\r\n    [EditorBrowsable(EditorBrowsableState.Never)]\r\n    public void Deconstruct(out TKey key, out TValue value);\r\n}\r\n\r\npublic struct DictionaryEntry\r\n{\r\n    [EditorBrowsable(EditorBrowsableState.Never)]\r\n    public void Deconstruct(out object key, out object value);\r\n}\r\n```\r\n\r\n## Usage\r\n\r\n```cs\r\npublic void MyDictionaryMethod()\r\n{\r\n    var dict = new Dictionary<int, string>();\r\n    dict.Add(1, \"2\");\r\n    var (one, two) = dict.First();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/265836317","html_url":"https://github.com/dotnet/corefx/issues/13746#issuecomment-265836317","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/13746","id":265836317,"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-12-08T19:47:46Z","updated_at":"2016-12-08T19:47:46Z","body":"> do you know why we made them extension methods for Tuple? \r\n\r\n@weshaggard I did a straight port from corefx. I thought it is better to have consistency across platforms.\r\nI don't oppose making `Deconstruct` (and `ToValueTuple` probably) instance methods instead of extension methods."}}
{"actor":{"display_login":"jcouv"}}