{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/5023","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/5023/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5023/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/5023/events","html_url":"https://github.com/dotnet/roslyn/issues/5023","id":104979068,"number":5023,"title":"REQUEST:  Pattern matching/better type inferencing with generics.","user":{"login":"TonyValenti","id":13609558,"avatar_url":"https://avatars.githubusercontent.com/u/13609558?v=3","gravatar_id":"","url":"https://api.github.com/users/TonyValenti","html_url":"https://github.com/TonyValenti","followers_url":"https://api.github.com/users/TonyValenti/followers","following_url":"https://api.github.com/users/TonyValenti/following{/other_user}","gists_url":"https://api.github.com/users/TonyValenti/gists{/gist_id}","starred_url":"https://api.github.com/users/TonyValenti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonyValenti/subscriptions","organizations_url":"https://api.github.com/users/TonyValenti/orgs","repos_url":"https://api.github.com/users/TonyValenti/repos","events_url":"https://api.github.com/users/TonyValenti/events{/privacy}","received_events_url":"https://api.github.com/users/TonyValenti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/4%20-%20In%20Review","name":"4 - In Review","color":"CCCCCC"},{"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":null,"comments":21,"created_at":"2015-09-04T22:15:15Z","updated_at":"2016-06-16T10:24:56Z","closed_at":null,"body":"Hi Roslyn Team:\r\nWhen I was reading one of the feature requests from earlier:\r\nhttps://github.com/dotnet/roslyn/issues/2212#issuecomment-137754530\r\n\r\nIt made me think of something I have really been wanting as of late:\r\n\r\nPattern matching/better type inferencing with generics.\r\n\r\nToday I can write code like this:\r\n```\r\n        private static void Foo<T, X>(T Object) where T : IEnumerable<X>, IComparable<X> {\r\n            //Do Something\r\n        }\r\n\r\n        private class MyClass : IComparable<String>, IEnumerable<String> {\r\n            int IComparable<string>.CompareTo(string other) {\r\n                throw new NotImplementedException();\r\n            }\r\n\r\n            IEnumerator IEnumerable.GetEnumerator() {\r\n                throw new NotImplementedException();\r\n            }\r\n\r\n            IEnumerator<string> IEnumerable<string>.GetEnumerator() {\r\n                throw new NotImplementedException();\r\n            }\r\n        }\r\n\r\n        private static void CallMyFunction() {\r\n            var C = new MyClass();\r\n\r\n            Foo<MyClass, String>(C);\r\n        }\r\n```\r\n\r\nThere is nastiness is in how I have to call the function.\r\n```\r\n        private static void CallMyFunction() {\r\n            var C = new MyClass();\r\n\r\n            Foo<MyClass, String>(C);\r\n        }\r\n```\r\n\r\nIn this example, I feel as though Foo should automatically figure out the type parameters and I should be able to call the method as follows:\r\n```\r\n        private static void CallMyFunction() {\r\n            var C = new MyClass();\r\n\r\n            Foo(C);\r\n        }\r\n```\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/226447000","html_url":"https://github.com/dotnet/roslyn/issues/5023#issuecomment-226447000","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/5023","id":226447000,"user":{"login":"eyalsk","id":3756641,"avatar_url":"https://avatars.githubusercontent.com/u/3756641?v=3","gravatar_id":"","url":"https://api.github.com/users/eyalsk","html_url":"https://github.com/eyalsk","followers_url":"https://api.github.com/users/eyalsk/followers","following_url":"https://api.github.com/users/eyalsk/following{/other_user}","gists_url":"https://api.github.com/users/eyalsk/gists{/gist_id}","starred_url":"https://api.github.com/users/eyalsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyalsk/subscriptions","organizations_url":"https://api.github.com/users/eyalsk/orgs","repos_url":"https://api.github.com/users/eyalsk/repos","events_url":"https://api.github.com/users/eyalsk/events{/privacy}","received_events_url":"https://api.github.com/users/eyalsk/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T10:24:56Z","updated_at":"2016-06-16T10:24:56Z","body":"@gafter It's always possible to have something like `M<>(\"foo\");` to disambiguate, it was suggested in multiple posts before, what do you think about it? "}}
{"actor":{"display_login":"eyalsk"}}