{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/116","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/116/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/116/events","html_url":"https://github.com/dotnet/roslyn/issues/116","id":55791981,"number":116,"title":"Extend using directives to support unbound generics","user":{"login":"sharwell","id":1408396,"avatar_url":"https://avatars.githubusercontent.com/u/1408396?v=3","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/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"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Language-C%23","name":"Language-C#","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-28T18:01:58Z","updated_at":"2015-07-17T16:37:14Z","closed_at":null,"body":"I propose extending the **Using alias directives** feature of C# as follows.\r\n\r\n> *using-alias-directive*:\r\n> &nbsp;&nbsp;&nbsp;&nbsp;`using` *identifier* `=` *namespace-or-type-name* `;`\r\n> &nbsp;&nbsp;&nbsp;&nbsp;`using` *identifier* *generic-dimension-specifier* `=` *unbound-type-name* `;`\r\n\r\nThe *generic-dimension-specifier* and *unbound-type-name* productions are defined in the C# Language Specification description of the `typeof` operator.\r\n\r\nThe semantics of an unbound using alias directive are almost identical to the semantics of using alias directives as we know them; they merely provide the ability to associate a generic arity to the alias. The following additional requirements would be in effect:\r\n\r\n* It is a compile-time error if the *generic-dimension-specifier* and *unbound-type-name* do not have the same generic arity.\r\n\r\nSince this proposal is intended to solve a specific limitation in the support for `using` directives (for which there is no real workaround), it is written in the simplest form possible. It neither provides nor prevents a future expansion of the language from supporting partially-bound type parameters in a using alias directive; I believe this is a problem for another time.\r\n\r\n### Example\r\n\r\nC# currently allows the following using statements:\r\n\r\n```csharp\r\nusing System.Collections.Generic;\r\nusing MyList = System.Collections.Generic.List<string>;\r\n```\r\n\r\nThis expansion would additionally allow the following:\r\n\r\n```csharp\r\nusing List<> = System.Collections.Generic.List<>;\r\n```\r\n\r\nOne might argue that the duplication of `<>` on the left and right sides would be unnecessary. I believe the syntax should appear this way for the following reasons:\r\n\r\n1. With the exception of `var`, C# consistently requires types to specify generic type arguments or generic arity when referencing types. Using inference in this specific case would be misleading, especially for the following:\r\n\r\n    ```csharp\r\n    using List = System.Collections.ArrayList;\r\n    using List = System.Collections.Generic.List<>; // arity inference here is confusing\r\n    ```\r\n\r\n2. Arity inference could cause future challenges to a language extension designed to support partially-bound type parameters in a using alias directive."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/122335430","html_url":"https://github.com/dotnet/roslyn/issues/116#issuecomment-122335430","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/116","id":122335430,"user":{"login":"HaloFour","id":10102290,"avatar_url":"https://avatars.githubusercontent.com/u/10102290?v=3","gravatar_id":"","url":"https://api.github.com/users/HaloFour","html_url":"https://github.com/HaloFour","followers_url":"https://api.github.com/users/HaloFour/followers","following_url":"https://api.github.com/users/HaloFour/following{/other_user}","gists_url":"https://api.github.com/users/HaloFour/gists{/gist_id}","starred_url":"https://api.github.com/users/HaloFour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaloFour/subscriptions","organizations_url":"https://api.github.com/users/HaloFour/orgs","repos_url":"https://api.github.com/users/HaloFour/repos","events_url":"https://api.github.com/users/HaloFour/events{/privacy}","received_events_url":"https://api.github.com/users/HaloFour/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T16:37:14Z","updated_at":"2015-07-17T16:37:14Z","body":"Per your request I have opened a separate proposal.  Feel free to beat it up.\r\n\r\nI fully recognize that this would involve more effort and likely has more complications than I've enumerated but I'd rather follow the path and see where it leads.  Shake as many issues out into the open.  Maybe it's not as bad as we think."}}