{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/5058","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/5058/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5058/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/5058/events","html_url":"https://github.com/dotnet/roslyn/issues/5058","id":105262775,"number":5058,"title":"Proposal: Type Parameter Pack (Variadic Generics)","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"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Discussion","name":"Discussion","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/2","html_url":"https://github.com/dotnet/roslyn/milestones/Unknown","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/2/labels","id":937398,"number":2,"title":"Unknown","description":"This represents work which is not planned for a specific release.\r\n\r\n<!---\r\n@huboard:{\"order\":0.25}\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":384,"closed_issues":101,"state":"open","created_at":"2015-01-15T20:46:02Z","updated_at":"2015-11-14T19:11:03Z","due_on":null,"closed_at":null},"comments":21,"created_at":"2015-09-07T20:04:34Z","updated_at":"2015-11-16T20:41:48Z","closed_at":null,"body":"With growth of generic constructs in language, this would cause to eliminate a great deal of repetitive code. Having\r\n\r\n```\r\npublic delegate void Action<in T...>(T... args);\r\npublic delegate TResult Func<in T..., out TResult>(T... args);\r\n```\r\none may define (from Rx):\r\n```\r\npublic static Func<TArg..., IObservable<Unit>> FromAsyncPattern<TArg...>(Func<TArg..., AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end) { ... }\r\n```\r\n\r\nAnd in record types:\r\n\r\n```\r\npublic struct ValueTuple<T...>(T...);  // using #6115\r\npublic sealed class Tuple<T...>(T...);\r\n```\r\n\r\nThe compiler might generate these types eventually (for example, if tuples have unlimited items) but in this way it would share the template, type-safely with the developer.\r\n\r\nThis would be more of a clr improvement, but it's interesting to see how it would come out in the language."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/157163179","html_url":"https://github.com/dotnet/roslyn/issues/5058#issuecomment-157163179","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/5058","id":157163179,"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-16T20:41:48Z","updated_at":"2015-11-16T20:41:48Z","body":"@gafter \r\n>In the record type `ValueTuple<int, string>` that you declared, what are the names of the constructor parameters? What are the names of the fields or properties of the type?\r\n\r\nElaborating on your question; just like #6115 where you would not specify names for record members\r\n```cs\r\nclass Foo(Bar,Baz);\r\n```\r\nconstructor parameters and fields names would be generated by the compiler but not properties, hence they are not accessible through them. One would be able to use patterns for positional deconstruction. \r\n\r\nFor tuples (since the items would be declared in the usage and \"erased\" in compile-time) default names like `Item1`, `Item2` wouldn't make much sense. That said, the record type declaration,\r\n```cs\r\npublic struct ValueTulple<T...>(T...);\r\n```\r\ncould be used as the underlying type of tuples of any size."}}