{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/6248","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/6248/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6248/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/6248/events","html_url":"https://github.com/dotnet/roslyn/issues/6248","id":112884706,"number":6248,"title":"Proposal: Default Generic Type Parameter","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},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-10-22T20:26:49Z","updated_at":"2015-10-28T02:29:19Z","closed_at":null,"body":"The ability to specify a default type for a generic type parameter:\r\n```cs\r\nclass Foo<TBar = Bar, TBaz = Baz> {}\r\n```\r\nAs a real world example, the `IdentityDbContext` class in ASP.NET Identity:\r\n```cs\r\nclass IdentityDbContext<TUser = IdentityUser, TRole = IdentityRole, TKey = string, TUserLogin = IdentityUserLogin, TUserRole = IdentityUserRole , TUserClaim = IdentityUserClaim> where ...\r\n```\r\nto avoid the need to declare different subtypes for different default types like\r\n```cs\r\nclass IdentityDbContext : IdentityDbContext<IdentityUser, IdentityRole, string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim> { ... }\r\nclass IdentityDbContext<TUser> : IdentityDbContext<TUser, IdentityRole, string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim> where TUser : IdentityUser { ... }\r\n```\r\nIn companion with improved type aliases can avoid [this](http://www.asp.net/identity/overview/extensibility/change-primary-key-for-users-in-aspnet-identity) for god's sake.\r\n\r\nTo use default type parameters, one may skip the type parameter as follow:\r\n```cs\r\nvar foo = new Foo<,>(); // new Foo<Bar, Baz>()\r\nvar foo = new Foo<A,>(); // new Foo <A, Baz>()\r\n```\r\nThis has some interactions with generic type argument inference proposals like #5429 or #2319.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/151702494","html_url":"https://github.com/dotnet/roslyn/issues/6248#issuecomment-151702494","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6248","id":151702494,"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},"created_at":"2015-10-28T02:29:19Z","updated_at":"2015-10-28T02:29:19Z","body":"@MgSam Any further details on what work? Higher-kinded types? If anything it is years away, and would be led by changes to F# and CLR."}}