local type alias #445
Unanswered
stephentoub
asked this question in
General
Replies: 1 comment
-
Probably the same as #218 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From @juliusfriedman on July 19, 2016 14:40
Currently class declarations do not allow nested type aliasing e.g.
using MyTuple = System.Tuple<int, int>;
even within a namespace declaration...This declaration must normally be at the top of a file and precede all other using statements such as
extern
.I propose that this restriction be lessened such that to allow one to use such aliases within their definitions to avoid redundant typing.
The only way this can be achieved now is to separate each class into it's own file and definitions of the class which fulfill the rule of the compiler by using
partial
or by declaring their own type which represents the type layout desired [thus reducing the use of a perfectly good structure such asTuple
simply due to the anonymity associated with such structures.].Thank you for your time and consideration.
Copied from original issue: dotnet/corefx#10150
Beta Was this translation helpful? Give feedback.
All reactions